1.Char 5: fatal error: control may reach end of non-void function [-Wreturn-type]
}
1.Char 5: fatal error: control may reach end of non-void function [-Wreturn-type] }
这类报错的含义是:
没有考虑所有可能的返回值情况
什么意思呢,比如我们的Java程序的一个方法:
public int fun(int a)
{
if(a>0)
return 1
else if(a<0)
return -1;
}
那么如果我们的a==0那么就没有返回值,所以本方法没有考虑返回值情况
博主会持续更新