0
我使用在Windows 8 textpad,安装为MinGW的编译C简单的C错误 - #include?
不知道为什么,这是造成麻烦:
#include <stdio.h>
int main (void)
{
printf("To C, or not to C: that is the question.\n");
return 0;
}
错误说
C:\Users\Admin\Desktop\C files\pun.c:1:2: warning: null character(s) ignored [enabled by default]
#
^
C:\Users\Admin\Desktop\C files\pun.c:1:3: error: invalid preprocessing directive #i
#
^
cc1.exe: out of memory allocating 838860800 bytes
Tool completed with exit code 1
您的文件可能以BOM标题开头(如果是Windows下的“Unicode文本”,特别是)。确保它没有。 – zneak
...并同样确保你没有保存为UTF-16。这可以解释一个明显的NULL字符在那里跳跃。 – Tommy
是的,请确保将其保存为UTF-8或“ANSI文本”等。 –