+ 3
What is getch()
i dont know sir
4 Answers
+ 30
I haven't seen use of getch() in c++
In C though.. it is used to get a char input from keyboard when you see the output...*I maybe wrong here*
eg:- when the output of your code is 5 it will stay on the screen until you press any char from keyboard.
It is used bcz the default output lasts for fraction of seconds and is not visible, so we sort of pause it.
+ 4
getch() reads a single byte character from input. getch() is away to get a user inputted character. it can be used to hold program execution but the "holding" is simply a side-effect of its primary purpose, which is to wait until the user enters a character.
+ 4
One interesting thing about getch() is that, unlike taking input from cin, it does not wait for the enter key to be pressed; the input is taken immediately. Also, as noted, it is not displayed on the screen.
0
get() function for input single char