Re: [OT] A bit confused on pointers...
Re: [OT] A bit confused on pointers...
- Subject: Re: [OT] A bit confused on pointers...
- From: Camillo Lugaresi <email@hidden>
- Date: Fri, 30 Dec 2005 19:31:44 +0100
On 30/dic/05, at 17:45, Greg Herlihy wrote:
On 12/30/05 5:45 AM, "Camillo Lugaresi" <email@hidden>
wrote:
On 30/dic/05, at 11:10, Andreas Mayer wrote:
Am 29.12.2005 um 21:39 Uhr schrieb Clark Cox:
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.
But there's never any ambiguity about whether the operator is unary
or binary in an expression.
Never? The * operator is inherently ambiguous. Consider:
a * b;
Is b a pointer to a or is the expression a multiplied by b? Without
any
context it is impossible to know for sure. Either interpretation
constitutes
a legal expression in C.
Alright, I'll give you that: it is ambiguous if you don't know
whether a is a type or a variable. But if you don't know what a is,
you cannot tell what the statement means, and if the compiler doesn't
know what a is, it cannot compile the statement. Thus, that syntactic
ambiguity changes "I can't tell what this code does/I can't compile
it" into "I can't tell what this code does/I can't compile it", ie it
has no bearing altogether. :-)
Camillo
_______________________________________________
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