int main()
{
return 1;
}
int main()
{
return 14;
}
int main()
{
}
Above codes compiled successfully on Microsoft Visual Studio 2013 and no problems occurred.
So what kind of problems the above codes may cause?
int main()
{
return 1;
}
int main()
{
return 14;
}
int main()
{
}
Above codes compiled successfully on Microsoft Visual Studio 2013 and no problems occurred.
So what kind of problems the above codes may cause?
The return value from your main method is passed to whatever caused your program to be run.
In many cases (manual running) this return value is ignored, but in other places it can be used to change logic for example in batch or shell script programs.
The general convention is that a return code of 0 is success, anything else is a specific error or signal that can then be acted on by the calling program/script/user/whatever.