Re: *?
Re: *?
- Subject: Re: *?
- From: Carlos Weber <email@hidden>
- Date: Fri, 22 Jun 2001 15:34:47 -1000
On Friday, June 22, 2001, at 10:22 , Finlay Dobbie wrote:
all obj-c objects are pointers, they are never statically allocated.
myArray is actually a pointer to an NSMutableArray. i'm surprised your
C book doesn't have more on pointers, they're a fundamental thing that
you need to understand, and are not terribly easy to grok in the
beginning.
-- Finlay
On Friday, June 22, 2001, at 07:06 pm, email@hidden wrote:
which says that myArray is of type "NSMutableArray" instead of generic
type "id". But there is no explanation that I can find as to what
the * does or means in the first two examples. My copy of Kernighan
and Ritchie just came and I looked there, but all I could find was a
usage somewhat similar on page 94 that uses the * to indicate that an
argument is a pointer to a type. So, all I can guess is that in the
example:
To add a little to that, usage like
NSMutableArray *myArray; //
<dataType><space>*<variableNameWithNoSpaceInFront>
is just the way that most programmers are used to reading this
particular idiom. As far as the compiler is concerned you can put spaces
before the star, after the star, before and after, or neither before or
after. It's readability and whatever helps your thinking.
References: | |
| >Re: *? (From: Finlay Dobbie <email@hidden>) |