我来自python背景,其中以下内容是有效的:
def f():
import someLibrary
someLibrary.libraryFunction()
因此,当我需要调试C代码时,我在函数中间写道:
void f(int param)
{
int status;
/* other code */
#include <stdio.h>
printf("status: %d", status);
/* more code */
}
它像我预期的那样编译和工作。后来有人向我指出,这是不应该编译的,因为C预处理器确实取代了#include~ statement with the contents of
stdio.h`。那么为什么这是有效的代码呢?
https://stackoverflow.com/questions/56346814
复制相似问题