I am a new programmer in visual studio (using the 2008 version)
I have 2 questions. Maybe someone can help me with them.
when you run my program, it prints a selection of things, it opens cmd windos, and then closes it right away. How can I make this window stay open and not close?
I want to save the output to a file. I want to automatically redirect the output from the program to the txt file. How can I do it? I know that I can do this through the cmd window using sone of type '<' command .. but I need to use Visual Studio Compiler (and not gcc / g ++), is there a way to get the output to a file?
On the first question, I also had problems with this. I have no real solution, but I just put:
int a; cin >> a;
at the end of the program, causing the window to not close until I type in a number.
1) There is no IDE option for this. You must add system("pause"); or cin.get(); at the end of your main .
system("pause");
cin.get();
main
Source: https://habr.com/ru/post/1389874/More articles:Clojure tail call recursion with variable argument function - clojureThe system cannot find the specified path - c #LandscapeOrientation when running didload method on c - iosShow JDialog ("Wait") on JFrame - javaHow to set do-nothing handler for by-name parameter? - scalaHow can I output when debugging in Visual Studio 2008? - c ++Round Down to the nearest border in dateTime - c #Is it possible to compress a JPEG file with zip libraries - c #How to exit a program using the close button in XCB - linuxUI blocking with HTML and CSS - javascriptAll Articles