Actually, it is possible. You need to use token concatenation.
#define DEFINE_FUNC( n ) void func_ ## n()
You would use it in the normal way:
DEFINE_FUNC( 12 );
The preprocessor would turn that into:
void func_12();
While I can't imagine why you want to do this, there are, in fact, legitimate reasons to do token concatenation (which goes a long way into explaining why the preprocessor can do it at all).
Hope this helps.
Reputation Points: 1140
Solved Threads: 229
Postaholic
Offline 2,039 posts
since Oct 2007