K
Keith Thompson
Will both of you please knock it off?
The OP asked:
Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
(Yes, there was more context than that.) What the OP *meant* was to
ask whether an lvalue of pointer type is referred to as a "pointer",
and an rvalue of pointer type is referred to as an "address". (I
won't try to answer the question here.)
Given that meaning, and given the additional context, what the OP
wrote is, I think, a reasonable way to ask the question.
Given the way the question was phrased, it's not entirely unreasonable
to assume, mistakenly, that the OP meant that lvalues in general are
referred to as "pointers".
In fact, given a different set of terminology, that's not an entirely
unreasonable way to look at it. Given:
int foo;
foo = 42;
the expression "foo" in the assignment statement is an lvalue. You
can think of it as implicitly taking the address of foo; after all,
the machine needs to know where foo is to be able to assign a value to
it. This breaks down for two reasons: you can assign a value to a
"register" variable, which doesn't necessarily have an address, and
the C standard doesn't talk about it that way. In the abstract
machine defined by the C standard, taking the address of the target
isn't part of an assignment statement (even though it may happen on
the machine level). But you could easily define an abstract machine
in which it is, which makes it even easier to assume that that's what
the OP had in mind. I don't know (or much care) whether anyone in
this discussion thought of it that way.
This is a discussion group. Misunderstandings happen all the time.
The usual approach is to clarify what was meant and move on.
Endless cascades are frowned upon. It's usually appropriate to
provide some context, but it seldom makes sense to quote the entire
previous article.
If you want to call each other idiots, either for not writing clearly
or for not reading clearly, this is not the place for it. If you
don't want to talk about C, please talk somewhere else.
The OP asked:
Isn't the lvalue called a POINTER TO and the (r)value called the
ADDRESS OF?
(Yes, there was more context than that.) What the OP *meant* was to
ask whether an lvalue of pointer type is referred to as a "pointer",
and an rvalue of pointer type is referred to as an "address". (I
won't try to answer the question here.)
Given that meaning, and given the additional context, what the OP
wrote is, I think, a reasonable way to ask the question.
Given the way the question was phrased, it's not entirely unreasonable
to assume, mistakenly, that the OP meant that lvalues in general are
referred to as "pointers".
In fact, given a different set of terminology, that's not an entirely
unreasonable way to look at it. Given:
int foo;
foo = 42;
the expression "foo" in the assignment statement is an lvalue. You
can think of it as implicitly taking the address of foo; after all,
the machine needs to know where foo is to be able to assign a value to
it. This breaks down for two reasons: you can assign a value to a
"register" variable, which doesn't necessarily have an address, and
the C standard doesn't talk about it that way. In the abstract
machine defined by the C standard, taking the address of the target
isn't part of an assignment statement (even though it may happen on
the machine level). But you could easily define an abstract machine
in which it is, which makes it even easier to assume that that's what
the OP had in mind. I don't know (or much care) whether anyone in
this discussion thought of it that way.
This is a discussion group. Misunderstandings happen all the time.
The usual approach is to clarify what was meant and move on.
Endless cascades are frowned upon. It's usually appropriate to
provide some context, but it seldom makes sense to quote the entire
previous article.
If you want to call each other idiots, either for not writing clearly
or for not reading clearly, this is not the place for it. If you
don't want to talk about C, please talk somewhere else.