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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -