Can I use getch() instead of return 0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can I use getch() instead of return 0

19th Jan 2017, 5:45 PM
Mohammed Sabith
Mohammed Sabith - avatar
3 Answers
+ 4
yes! and you can remove return 0 out
19th Jan 2017, 6:14 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
Well how can you replace return 0 by getch(). In any function if something is to be returned you must then return something return 0,return 1,return 8837 anything but how can you use getch(). If the main type is void if supported by your compiler we write getch() at end so that the program exist only after user wants there we can remove the getch() statement without any error. If I am wrong please tell me. My exams are very near so clarify my concept if I am wrong.
20th Jan 2017, 10:54 AM
Megatron
Megatron - avatar
+ 1
I am a beginner
20th Jan 2017, 12:25 PM
Mohammed Sabith
Mohammed Sabith - avatar