+ 1

What is the difference between int main () and void main()?

31st Jul 2016, 3:33 AM
Nikhil
3 Answers
+ 4
on the website of the author of c++ it's said in the FAQ that void main is not c++. So the best is to avoid it, even if some compilers allow that, it is not standard... A program should return 0 when everything gas been done with success and an other int value to refer an error code when something got wrong. source : http://www.stroustrup.com/bs_faq2.html#void-main
31st Jul 2016, 6:58 AM
Dorian
+ 2
int main should return a value means return 0; and void means null not require return value.
31st Jul 2016, 3:42 AM
Vyas Arpit
Vyas Arpit - avatar
- 1
Compile easily
31st Jul 2016, 3:34 AM
jaaveeth H
jaaveeth H - avatar