相关疑难解决方法(0)

在#include语句中使用乱码字符时没有编译器错误

#include <iostream> gfhgfhgf
using namespace std;

int main() {
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

为什么这段代码片段会被编译?根据包含语法的gcc参考:

如果文件名后面的行上有任何内容(注释除外),则会出错.

而这正是代码中正在做的事情.

c++ compiler-errors c-preprocessor

9
推荐指数
1
解决办法
247
查看次数

标签 统计

c++ ×1

c-preprocessor ×1

compiler-errors ×1