0
why does main funtion needs "int" declaration?
5 Answers
+ 1
to..
+ 1
to... return the state of execution at the end of the program.
0 = no problem, GG!
other values may refer to errors numbers.
In that way, final users know, for example, that if the return is 2, there is a problem in reading files.
0
when you declare int function int can return only int value instead of float etc
0
when you declare int you are specifying the data type of the function so that compiler can understand what kind of values it must accept. You may also use other data types such as void etc
0
using other return type for main is not recommended and can make trouble with some compiler