+ 1
Why we can not use void instead of int to a main function
3 ответов
+ 15
Data type void for main function has been slowly deprecated, since main functions should return values to the system.
+ 2
void main() or getch() are from old/outdated C/C++ implementations. You should not use them. You should use int main() and return a value to the operating system to indicate whether your program has exited normally.
getch() is function from conio.h which is MS-DOS library. It's not part of C/C++ standard library so you shouldn't use it. You can use getchar() instead.
0
can I use getch in c++?