想想以下代码的执行结果是什么?
--------------------------------------
#define VERSION 1234
#define MK_STR(x) (#x)
void print_version() {
printf( MK_STR( VERSION ));
}
--------------------------------------
"1234" 吗?——错,输出是:"VERSION"!!
ANSWER
--------------------------------------
#define NUMBER B85800 // this can be defined in the command line
#define VAL(str) #str
#define TOSTRING(str) VAL(str)
unsigned char part1[10] = TOSTRING (NUMBER); // generates "B85800"
unsigned char part2[10] = VAL(NUMBER); // generates "NUMBER"
--------------------------------------