define - constant or literal Objective-C -
we have following code (in .h. or .m file of objective-c app)
#define square_size 28 #define app_delegate [[uiapplication sharedapplication] appdelegate]
are both of them constants or literals ?
what proper name? , literals suspect, why call them constants :)?
they're neither, they're macros.
a constant this:
const int square_size = 28;
the difference between macro , constant here constant has type while macro text fragment gets inserted @ place it's mentioned before compiler parsing source code.
and literal 28
or @"this string"
, value.
Comments
Post a Comment