Search code examples
iphoneobjective-ccore-graphicscgfloat

Is CGFloat both a class and not?


Here's some instance variables in a header file from an iphone game develpment book:

CGFloat *point;
int count;
CGFloat vectorScale;

Now I'm absolutaley confused. What's that asterisk before the point ivar? Is CGFLoat a class as well as it's not?


Solution

  • A CGFloat is just a C typedef for float or a double depending on your platform. On modern machines its probably a double. This means that *point as a pointer to a float. Given that name, its probably (educated guess) a pointer to an interleaved array of x y coordinates.