0

What is the use of getch() in C++ programs. ?

12th Dec 2017, 2:00 PM
SHUBHAM KARJEE
SHUBHAM KARJEE - avatar
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
12th Dec 2017, 3:24 PM
Jonathan Álex
Jonathan Álex - avatar
0
Indeed, it's an obsolete resource
12th Dec 2017, 4:29 PM
Jonathan Álex
Jonathan Álex - avatar