What is the use of getch() in C++ programs. ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

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

12th Dec 2017, 2:00 PM
Shubham Karjee
Shubham Karjee - avatar
2 Respostas
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