0

why I can't use void main()....when I am doing program in this app

21st Jan 2017, 6:45 AM
Tushar joshi
Tushar joshi - avatar
2 Antworten
+ 6
because main needs to return a value to the operating system
21st Jan 2017, 7:03 AM
jay
jay - avatar
+ 2
This question is asked a lot of time here on this forum and has been answered a lot of times too. By the way, 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 has 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
21st Jan 2017, 7:40 AM
Dorian