小编Ren*_*h G的帖子

列出C程序中的所有#defines

是否可以在执行时获取C程序中使用的#defines列表(编译时间和源代码中定义的).因为我有一个拥有大量C源文件的项目.

是否有任何编译时选项来获得它?

c

2
推荐指数
1
解决办法
167
查看次数

如何在C代码中转到上一行

如果为以下代码:

printf("HEllo\n");    // do not change this line.
printf("\b\bworld");
Run Code Online (Sandbox Code Playgroud)

我需要一个输出:Helloworld(在一行中)。但这行不通。有人可以解释原因吗?和其他转义序列(如果有)。

c escaping

2
推荐指数
2
解决办法
3万
查看次数

在C中接收功能名称

我有这样的程序,

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

2
推荐指数
1
解决办法
885
查看次数

C中"int const*"的确切含义是什么?

可能重复:
const int = int const?
C中的Const

我想知道C中"int const*"的确切含义,以及嵌入式编程系统中"const int*"和"int const*"之间的小比较.

__kanu

c

0
推荐指数
1
解决办法
3463
查看次数

标签 统计

c ×4

escaping ×1