让第一行是:
#define TAG_LEN 32
现在,我需要将它与文字字符串常量连接起来;类似的东西:
puts("Blah" [insert your answer] TAG_LEN); // I need "Blah32".
让第一行是:
#define TAG_LEN 32
现在,我需要将它与文字字符串常量连接起来;类似的东西:
puts("Blah" [insert your answer] TAG_LEN); // I need "Blah32".
#define STR_NOEXPAND(tokens) # tokens
#define STR(tokens) STR_NOEXPAND(tokens)
puts("Blah" STR(TAG_LEN));
你可以做:
printf("Blah%d", TAG_LEN);
或者如果你有一个字符串
char *yourString;// initiate it with your value
printf("Blah%s%d",yourString, TAG_LEN);