Re: [OT] A bit confused on pointers...
Re: [OT] A bit confused on pointers...
- Subject: Re: [OT] A bit confused on pointers...
- From: Steve Bird <email@hidden>
- Date: Fri, 30 Dec 2005 09:01:09 -0500
On Dec 30, 2005, at 5:10 AM, Andreas Mayer wrote:
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.
Coming from Pascal (where you are forced to write var p: ^integer),
this made perfect sense to me, UNTIL I discovered that it doesn't
work the way I thought it would.
In Pascal, var p1,p2: ^integer declares TWO pointers to integers, but
in C, int* p1, p2 does NOT. As much as it makes sense to read it that
way, the compiler sees it otherwise.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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