0
What is the use of getch() in C++ programs. ?
4 odpowiedzi
0
It's a function that stops the flow of the code until you press a key on the keyboard, thus entering a char.
You can use system("pause"); instead from stdlib.h, but it prints a message on the screen warning you to press any button, while getch( ); just waits for the button to be pressed without any printed message.
In Code Playground it won't make great difference, but when working on IDEs and trully compiling .exe apps, the whole thing changes
0
Indeed, it's an obsolete resource