+ 2

Can we run our c++ program without getch()??

It means that what can we do to run our program without getch().

11th Jan 2020, 4:18 AM
Sahil Kalkal
Sahil Kalkal - avatar
5 Antworten
+ 1
getch() is used to hold the screen of output We can hold screen by initializing a variable that is not used in whole program and in the last of program cin the variable Then screen or program wait for input of the value of variable It is correct answer.
11th Jan 2020, 7:34 AM
Sahil Kalkal
Sahil Kalkal - avatar
+ 3
getch() function is not at all necessary to run a programm. it's motive is to get a single character input from the user at the time of execution Generally it is used to stop the system from executing the program and exiting the console window in old DOS based compillars (such as Turbo C++)
11th Jan 2020, 4:24 AM
Arsenic
Arsenic - avatar
+ 1
Sahil Kalkal that's only true for old DOS based IDEs. Modern IDEs don't require that, also getch() is no more a standard function in C++.
11th Jan 2020, 8:28 AM
Arsenic
Arsenic - avatar
0
Exactly Arsenic now new compilers doesn't need these. It was the case with Turbo C.
12th Jan 2020, 6:54 PM
Ishan Pandey
Ishan Pandey - avatar