相关疑难解决方法(0)

为什么一个函数中的预处理程序指令会影响另一个函数的编译?

程序编译成功并打印1000甚至没有foo()从我们的main()函数调用函数.这怎么可能?

#include<stdio.h>


void foo()
{
    #define ans 1000
}

int main() {

  printf("%d", ans);
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

c io c-preprocessor

4
推荐指数
1
解决办法
116
查看次数

标签 统计

c ×1

c-preprocessor ×1

io ×1