+ 4
What's the difference between void main() and int main()?
5 odpowiedzi
+ 5
When we return 0 at the end ( while using int as the return type) it tells the OS that the program is functional and is without any error(except logical error), as main function is called by OS and it returns 0 to the OS. In C++, there is no difference, both are same.
+ 1
When ur function returning a value... U have to use int main() & when not then use void main()..!!!
They show the return type of a function..
0
If it's void, explicitly return value is not mandatory.
But in case of int main() it demands a return value.
Basically, it's your choice how you want your main() to act.
I'm not very sure if I'm correct.
0
void does not return anything but int does
0
void as the name suggests , basically means that your programme need not return any value while int main means the program after compilation must return a value and of type integer