想想以下代碼的執行結果是什么?
--------------------------------------
#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"
--------------------------------------