20180217-c语言 何消除 warning no newline at the end of file
c-free编译器总是出现一个警告,如何消除warning:no newline at the end of file
连最简单的程序也是这样:
#include <stdio.h>
int main()
{
int a,b,sum;
a=123;b=456;
sum=a+b;
printf("sum is %d\n",sum);
}
我有更好答案
最佳答案
你在程序代码的最后面多敲一个空行,也就是说在右括号后打个回车键。因为gcc对你的源文件有要求,就是.c or .cpp文件后面要有一个空行,不然就有一个warning.你可以无视它。