出现“error c4430缺少类型说明符-假定为int。注意C++不支持默认int

出现这种错误的原因,是因为函数没有写返回值。是在VC6.0的工程转为高版本(VS2010)的时候经常出现的;

#include <stdio.h>  
main()  
{   
    printf("hello,world
");  
}  

上面的代码在VC6.0中编译没错,但在VS2013编译出错,因为主函数没有返回值,加上void即可。

原文地址:https://www.cnblogs.com/shixiangwan/p/7068660.html