I’m not sure what macros are. For example the following macro is found in the cocos2d framework written in objective-c. What exactly is a macro,why are they useful, and how do I define them? Thanks.
#define CCRANDOM_0_1() ((random() / (float)0x7fffffff ))
Here you’ll find everything you need:
http://gcc.gnu.org/onlinedocs/cpp/Macros.html
But to get a basic idea, they are pieces of code that replace the macro name when you write them in your code.
In your example, if you wrote:
It would be the same as: