<分区>
Possible Duplicate:
How to stringify an expression in C
我希望我能在这里找到我的问题的一些解决方案。
我想添加 ADD1 中定义的十六进制数字,需要将它们以字符串形式放入 *str
中。
This is only a example, to prove its possibility first. I am actually doing the same in a header file.
#include <stdio.h>
#define XMK_STR(x) #x
#define MK_STR(x) XMK_STR(x)
#define ADD1 0x6000+0x10
main()
{
char *str = "START " MK_STR(ADD1) "\n";
printf(str);
}