+ 1
I don't anderstand ...
why it say is int main..not void main 😫
4 Respuestas
+ 19
int main /////// return 0(It returns 0 to main i.e void)
is same as
void main
+ 2
int or void is a return type with function.
+ 2
In previous compilers like Turbo main can be of void type(i.e. not returning anything) but on the other hand in new CPP compilers like GCC and visual c++ main() should return something therefore its data type is preferred as integer and if you don't want the function to return anything you simply pur a return 0 statement as the last one. HappyCoding.
0
It returns an Int so that if your code finishes properly, then it will return a 0, but if there's an error, it will return another number, let's say -1