Click here to Skip to main content
16,019,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
#define A3FID(T) A3FCHUNCK_ID_##T
#define A3FNAME(T) A3FCHUNK_NAME_##T
#define A3F_ID_NAME(T) ((const unsigned long)A3FID(T)),A3FNAME(T)


Please explain above Code? IS is Macro? What may be T? It shows undefined.. but does not give any Error...
Posted

Each #define statement creates a macro. The first two prefix some value with a label, and the third generates some statement for example:
A3F_ID_NAME(22)

// generates
((const unsigned long)A3FCHUNCK_ID22, A3FCHUNCK_NAME22

However, I have no idea what code this is supposed to generate without seeing more of your source. The ## operator is the token paster[^], used by the preprocessor.
 
Share this answer
 
Yes, they are macros that uses concatenation. The 'T' is the parameter that you pass to the macro.

e.g. a statement like "int a = A3FID(PARAM);" will translate(after preprocessing) into "int a = A3FCHUNCK_ID_PARAM;"

hope that helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900