Re: Typecasting in Cocoa?
Re: Typecasting in Cocoa?
- Subject: Re: Typecasting in Cocoa?
- From: Jim Correia <email@hidden>
- Date: Fri, 28 Dec 2001 21:27:58 -0500
At 6:07 PM -0800 12/28/01, Alexander Dvorak wrote:
I am trying to do some calculations (Mandelbrot stuff)
in my program which require "double" accuracy and
would like to typecast an integer as a double. I
tried to typecast in the manner I know how (in C and
C++) and the compiler gave an error.
short x,y;
double zReal;
x = 5;
zReal = 3.6*(double(x));
// and also 3.6*(x(double)) and other variations
Can you typecast in Cocoa, and if so how?
Cocoa is a set of frameworks. The language is Objective-C. So the
question is can you typecase in Objective-C. The answer is yes - the
same way as in C.
(double)x
Neither of the syntax examples you give above are valid C or C++.
Jim