Re: [OT] A bit confused on pointers...
Re: [OT] A bit confused on pointers...
- Subject: Re: [OT] A bit confused on pointers...
- From: Andreas Mayer <email@hidden>
- Date: Fri, 30 Dec 2005 11:10:19 +0100
Am 29.12.2005 um 21:39 Uhr schrieb Clark Cox:
what is confusing about the syntax?
If (ptr) is a pointer, then (*ptr) is whatever it points at
Umm... what's *not* confusing about that syntax?
* is usually associated with multiplication.
And as Pontus pointed out, it doesn't help that the same symbol is
used in the declaration of pointers. To make things worse, it's
customary to write int *ptr instead of int* ptr, which would be
more accurate in my opinion. The '*' modifies the type, after all,
not the identifier.
Then there is the & operator, which is often used in conjunction with
pointers; and of course, this character does have a different meaning
when used as a binary operator. To make things worse, there's also &&.
It would be so much more readable if pointers where just declared
as int pointer myPointer and dereferenced like deref(myPointer)
or something like that.
Actually I don't like the C declaration syntax anyway. There should
be a special character clearly separating the type from the identifier.
int pointer: myPointer;
But this is all really off topic and C will not change, no matter how
much we discuss it.
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden