Possible Duplicate:
C preprocessor and concatenation
can anybody explain with example ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It allows to construct indentifiers from their parts. Eg:
would expand
CLASS_NAME(alpha)toCLASS__alpha. It is vastly used in tricks used by the boost preprocessor library, eg.which would expand
IF(0, a, b)toaandIF(1, a, b)tob. Also, sometimes, it is used to generate struct and function names (akin to c++ templates).