Structures, Pointer and gets

J

Joe Wright

Thomas said:
"Others call an address value a pointer. I understand but I disagree."

I hope I never see you talking about a function returning pointers.
Oh and did you know that the unary & operator returns a pointer?
The standard is very clear on the matter.
Really? Functions 'return' values. Operators 'yield' values. Values
which are addresses of objects have type 'pointer to T' but they are
still values and not pointers. This because pointers are objects!
If this is just your opinion please say so, because I am not
interested in discussing your opinion proper, which is what we
appear to be doing.
Are you becoming bored with me Thomas?

Can you give me your definition of 'pointer' which is not ambiguous? Is
it a value or an object? Is it both? Is it neither? Straighten me out
here.
 
T

Thomas Stegen

Joe said:
Are you becoming bored with me Thomas?

[snip]

Sorry about that. I didn't mean to send that article and when
I did I tried to cancel it, but I was too late apparently. Apologies
for that. Everything I said in that article is hereby declared null
and void. The other article I sent a bit later is better argued and
more decent in all respects.
 
J

Joe Wright

Thomas said:
Ok, I've had a look at the standard and it does not define the
term "pointer" at all. So saying you disagree that the unary &
operator returns a pointer has no foundation anywhere. You even
disagree with K&R which states at least once that function
such and such returns a pointer to whatever. The standard also
does this. So the consensus between the standard and K&R is that
functions do return pointers. And the 2 other books I checked
also does this.

Also consider how awkward it is if only objects of type pointer
to T can be called pointer. You cannot say that a function takes
a pointer as an argument for example. It seems that pointer
should be used to mean anything (object or value) that has pointer
to T and if you want to make a distinction you use object of type
pointer to T or value of type pointer to T.

It certainly seems like the consensus is against you when the two
most authorative sources available on C programming is against you.
Only two? Anyway Thomas you have been civil and a credit to our
community. I concede. I thank you for your interest in my proposition
and note (sadly) that no one else here seems interested at all. :)

Via con Dios.
 
I

Irrwahn Grausewitz

[Are addresses pointers?]
and note (sadly) that no one else here seems interested at all. :)

Hmmmmmm...... ;-)

How about:

In C, variables designate objects, and objects contain values.

Thus we can say:

Pointer variables designate objects that hold pointer values.

Expressions that evaluate to the address of an object yield such
a pointer value that can be stored in objects designated by a
pointer variable, a la:

int i = 42, *p = &i;

where p is a pointer variable and &i is a pointer value.

IIRC that was the consensus in one of the last discussions about
this matter. A google groups search will easily bring up some
threads where this has been discussed.

Regards
 
R

Richard Heathfield

Joe said:
Only two? Anyway Thomas you have been civil and a credit to our
community. I concede. I thank you for your interest in my proposition
and note (sadly) that no one else here seems interested at all. :)

Oh, we're interested all right. It's just that we already had this
discussion quite recently, so we're just watching the fireworks. :)
 
J

Joe Wright

Richard said:
Oh, we're interested all right. It's just that we already had this
discussion quite recently, so we're just watching the fireworks. :)
Voyeurs? I brought this up here several years ago and Kaz shot it down.
I bring it up about once a year now because it really bugs me. Thanks
for listening.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
474,302
Messages
2,571,549
Members
48,351
Latest member
Wilson01
Top