Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
Modern C++ would return 0 automatically for you (but you're probably using an old version of c++). Also, getch() and return 0 do completely different things. return 0 exits a function that returns a number (in this case it's main) and getch lets you input a character. getch() can be used as a trick to stop your program. Another thing to point out here, getch() isn't standard. You're probably using TCC, which is outdated. Read this for more info: https://www.sololearn.com/discuss/288609/?ref=app
12th Oct 2018, 1:46 PM
qwerty
qwerty - avatar