Re: static typing (Learning Cocoa Chapter 13)
Re: static typing (Learning Cocoa Chapter 13)
- Subject: Re: static typing (Learning Cocoa Chapter 13)
- From: Ondra Cada <email@hidden>
- Date: Sat, 22 Sep 2001 22:54:24 +0200
Michael,
>
>>>>> Michael Grant (MG) wrote at Fri, 21 Sep 2001 13:19:40 -0500:
MG> I gotcha. It's not "dummyView" but "NSBox" that takes the asterisk,
MG> then. Thanks!
Ammmmm... not really. It's dummyView, which takes the asterisk -- _before_ itself.
NSBox *dummyView;
^^^^^ ^^^^^^^^^^
1 2
1 -- the type NSbox
2 -- the variable dummyView is a pointer to the type (NSBox).
The difference is if you declare more variables:
NSAnything *a,b,*c;
Now, 'a' and 'c' are pointers to NSAnything, whilst b is _not_ a pointer (in
case NSAnything is a class, it would be an error in ObjC).
For a detailed and complete discussion of types and declarations I would
recommend the "K&R" (Kernighan/Ritchie's book of the C language).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc