C Macro Magic
Posted: Wed Oct 20, 2004 3:06 am
Harumph... I need help. :-\
Given is:
#define SUFFIX X
I need some macro C( n ) that, given that n is a numerical literal (e.g. 42), expands to that same literal with SUFFIX appended:
C( 42 )
-->
42X
I never got familiar with the # and ## operator of the C preprocessor, and I'm lost. Any help appreciated.
Given is:
#define SUFFIX X
I need some macro C( n ) that, given that n is a numerical literal (e.g. 42), expands to that same literal with SUFFIX appended:
C( 42 )
-->
42X
I never got familiar with the # and ## operator of the C preprocessor, and I'm lost. Any help appreciated.