Expand|Select|Wrap|Line Numbers
- declare( ONE );
- declare( TWO );
- declare( THREE );
NUMBER_ONE (which substitutes 1)
NUMBER_TWO (which substitutes 2)
NUMBER_THREE (which substitutes 3)
e.g., right like if I had done:
#define NUMBER_ONE 1
#define NUMBER_ONE 2
#define NUMBER_ONE 3
this is, the macro would get the number accordingly to the order in which it has been declared.
I know I can do:
Expand|Select|Wrap|Line Numbers
- #define declare(NAME) { #define NUMBER_ ## NAME 1 }
I have gone through http://gcc.gnu.org/onlinedocs/gcc-4.3.0/cpp/ but couldn't figure out a way using that.
Anyone has got any idea?
Thanks.