是否可以在执行时获取C程序中使用的#defines列表(编译时间和源代码中定义的).因为我有一个拥有大量C源文件的项目.
是否有任何编译时选项来获得它?
如果为以下代码:
printf("HEllo\n"); // do not change this line.
printf("\b\bworld");
Run Code Online (Sandbox Code Playgroud)
我需要一个输出:Helloworld(在一行中)。但这行不通。有人可以解释原因吗?和其他转义序列(如果有)。
我有这样的程序,
void test(char* a)
{
printf("%s",a); // Trying to print the function name "add" here
return;
}
int add(int,int)
{
test(__FUNCTION__); // I need the function name add to be passed to the test function
...................
....................
}
Run Code Online (Sandbox Code Playgroud)
但是在构建时,我在这样的C编译器(gcc风格)中得到了错误,
传递'test'的参数1会丢弃指针目标类型的限定符
请看看这个,
/ R
喜
我想知道C中"int const*"的确切含义,以及嵌入式编程系统中"const int*"和"int const*"之间的小比较.
__kanu