L
Lawrence Kirby
On Sun, 06 Feb 2005 14:08:02 -0800, Luke Wu wrote:
....
The string literal itself i.e. the "Hello" in the source code is an lvalue.
True, but not very interesting or useful.
lvalues exist in the source code, objects exist in the execution
environment.
Lawrence
....
Objects can also exist without lvalues . For example,
1)
char *ptr = "Hello";
ptr = NULL;
/* Hereafter the object "Hello" (an array) is lost in our abstract
machine
never to be referred to by an lvalue */
The string literal itself i.e. the "Hello" in the source code is an lvalue.
2)
malloc(100);
/* Hereafter the object allocated (100 bytes) is lost, never to be
referred to by an lvalue */
True, but not very interesting or useful.
So objects and lvalues are different things.
lvalues exist in the source code, objects exist in the execution
environment.
Lawrence