Hi, I wrote a simple program in Visual Studio 2012 to add 2 and 3. The program will not run without "conio.h" and _getch();, the exe window disppears as soon as the program is compiled. Can someone explain to me why?
Function _getch checks keyboard buffer and if the user will pressed a key the function returns the control to the main and executing of the program will finished.
Header conio.h contains declaration of that function.
Before you get a ton of usefull replies, know just this - conio.h is not part of C++ as such, and in modern IDE, such as visual studio 2012 it is simply deprecated, and all examples of its use are getting a bit outdated.
Thanks, so if I want the console to remain up I will add conio in my code. Lastly, is there a place visual studio stores the value of "z", which is 3, that I can see it without using the console. Like in MATLAB where you can type in the variable in the command line and see the result after the program ran.