Macros are just replaced by their definition. When you #define k 1024;
and write if(k==1024)...
what the compiler actually sees is:
if(1024; == 1024) ...
which doesn’t compile.
The compiler doesn’t complain because sometimes you may actually want to add a semicolon (;
is called semicolon, not colon, which is :
) to your macro.
solved Colon after #define in Objective-C [duplicate]