C语言-何消除 warning no newline at the end of file
2018-02-26 11:29
751 查看
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.你可以无视它。
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.你可以无视它。
相关文章推荐
- warning no newline at the end of file
- main.c :10:2 warning: no newline at the end of file
- warning no newline at the end of file
- warning: no newline at the end of file
- warning: no newline at the end of file
- warning: no newline at the end of file
- error:warning no newline at the end of file
- main.c :10:2 warning: no newline at the end of file
- warning no newline at the end of file
- warning no newline at the end of file
- warning no newline at the end of file
- warning no newline at the end of file
- warning no newline at the end of file
- no newline at the end of file
- C-free提示warning: no newline at end of file
- Warning: no newline at end of file
- Linux环境下warning: no newline at end of file
- warning: no newline at end of file
- 如何解决warning: no newline at end of file
- warning: no newline at end of file