Why i am writing return 0, why not write getch ???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Why i am writing return 0, why not write getch ????

27th Sep 2017, 1:31 PM
Rajendra hotta
Rajendra hotta - avatar
2 Answers
+ 9
I'm just going to assume that you were taught to write pre-standard C++ (which contains void main, conio.h, getch, etc) and just in case it is true: https://www.sololearn.com/Discuss/288609/?ref=app
27th Sep 2017, 2:27 PM
Hatsy Rei
Hatsy Rei - avatar
+ 4
It's just how C++ relays the exit status to your OS. 0 means it exited successfully, and 1 means it failed. This is good for being able to properly display errors as the program terminates.
27th Sep 2017, 1:38 PM
AgentSmith