P
Paul J. Lucas
Given this:
#define NUM 100
I was to use a CPP macro like:
char *p = MACRO(NUM);
and have MACRO defined such that it would expand to:
char *p = "100";
I tried:
#define MACRO(X) #X
but, for MACRO(NUM), that expands to:
char *p = "NUM";
How can I get CPP to expand NUM first?
- Paul
#define NUM 100
I was to use a CPP macro like:
char *p = MACRO(NUM);
and have MACRO defined such that it would expand to:
char *p = "100";
I tried:
#define MACRO(X) #X
but, for MACRO(NUM), that expands to:
char *p = "NUM";
How can I get CPP to expand NUM first?
- Paul