Re: Typecasting in Cocoa?
Re: Typecasting in Cocoa?
- Subject: Re: Typecasting in Cocoa?
- From: Jim Correia <email@hidden>
- Date: Sat, 29 Dec 2001 01:52:50 -0500
At 11:37 PM -0700 12/28/01, Rosyna wrote:
zReal = 3.6*(double(x));
is perfectly valid C++ (see Page 131, Section 6.2.8 of the C++
Programming Language, Third Edition by Bjarne Stroustrup)
Ack, at 12/28/01, Jim Correia said:
Neither of the syntax examples you give above are valid C or C++.
Correct - C++ introduces function style casts and I overlooked that.
(It isn't clear that this notation is extensible to pointer types (I
don't have the Stroustrup book handy) - int * - without a typedef so
perhaps you are better off using the familiar C syntax anyway.)
But since Objective-C is based on C, you need to use the C syntax,
which is also portable to C++.
Jim