K
Keith Thompson
Joona I Palaste said:TIWITAW.
W?
Joona I Palaste said:TIWITAW.
Yes, I did indeed, but ruse's and Roose's postings are definitely of
different style. And I do not consider either one to be smart enough
to successfully pretend to be somebody else.
Remember ruse: "... again, spoke your nose!" makes me still ROFL.![]()
Keith Thompson said:
int a;
&a;
(&a) is a pointer, but not an object.
int i = 6;
int * const p = &i; /* p is not a variable - or at least, to persuade anyone
that it is, you'd have to have kissed the Blarney. */
I disagree. (&a) in that context is an expression. To be a pointer, it
would have to be stored in something. .
Mark said:I disagree. (&a) in that context is an expression.
To be a pointer, it
would have to be stored in something.
Also, I think there is an important difference between the concepts
of "variable" and "object". A variable is a named, typed, object.
An object is, by itself, only storage. It can store a value, but
doesn't have any inherent type or name.
I can agree with that, but my impression is that this reasonable stance is
not the one that the majority of those in this newsgroup take.
I undestand this, but again my contention is that such bugs would be quite
obvious.
Code that depends on this simply would not work when ported and
tested for this first time.
But my larger point stands, that for pedagogical purposes, it is a useful,
concrete statement to say that a pointer is not unlike an array index.
An integer. Yes there can be other bits set, and so forth. But if you were a
C programmer who was NOT aware of this fact, I would seriously question you.
The Standard says that an object has a type.
Arthur J. O'Dwyer said:The Standard says that an object has a type. Why else would we
discuss "objects of type T" and "objects of type U"?
Mark said:I disagree. (&a) in that context is an expression. To be a pointer, it
would have to be stored in something. .
malloc returns a pointer to a typeless nameless object.
pete said:Sheldon Simms wrote:
The bit pattern stored in a nameless typeless object,
doesn't have any inherent value either.
"Pointer to allocated space", not "pointer to allocated object."
Mark McIntyre said:I disagree. (&a) in that context is an expression. To be a pointer, it
would have to be stored in something. .
This depends on the definition of a "pointer".
I think I'm going to have to ask for chapter and verse on that. Or I can
simply give you a counter-example: NULL. You see, NULL is most definitely a
pointer,
and yet, in the expression if(p != NULL) the NULL is not "stored
in anything" - that is, the RHS of the != is not the value of an object.
Mark McIntyre said:As far as I'm concerned, a pointer is an object that points to
something else, either another object, or a function, or nothing.
Mornington Crescent.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.