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

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

 

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

 

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

posted @ 2017-06-23 10:27  蓝鲸王子  阅读(6267)  评论(0编辑  收藏  举报