+ 2
Why main function returns a integer ?
3 Respostas
+ 6
It doenst metter actually, you can make it void and don't have to return anything
+ 4
because programs usually return with an integer code. 0 means regular exit, other means an error. depending the return value the caller can handle different outcomes.
+ 3
By cpp standard prohibited use of void on main function, this mean cpp main return a int.
return 0 -> program normal end
return negative value -> abnormal finish, like -1