#include <iostream> int main(int argc, char **argv) { while(!cin.get()){} } 'Miktor' <bi************@hotmail.com> wrote in message news:11*********************@g47g2000cwa.googlegro ups.com..
At the minute I am using the following rather unwieldy function to prevent the console window in Dev C++ from closing before I can see the output from my program: // function to prevent the Dev C++ Console Window from closing // before I can see the program's output void keepConsoleWindowOpen () { int any_number; std::cout << 'nn'; std::cout << 'Please enter a number to end the program:'; std::cout << 'nn'; std::cin >> any_number; } In order to prevent the console window from closing too soon, I call the above function with: keepConsoleWindowOpen (); This works, but I'm sure it's not the most elegant method to use. Does anybody else know of a better way to prevent the console window from closing too soon when writing a C++ program in Dev C++ ? Thanks in advance! BigBadMick (bi************@hotmail.com)
Visual Studio Keep Console Open
Starting with version 15.8.0 of Visual Studio 2017, which was released August 14, 2018, you have a new option for controlling whether the console window closes automatically when your C and C console-based application terminates, and what information you see when that happens.
Nov 08, 2014 Actually this problem is solved in the newer version of the Dev C.So either download that. Or Just put a getchar at the end of your code just before the return statement and so after the code completes its execution, the terminal window would.
Feb 02, 2014 CPSC 3145 C 2nd semester at www.govst.edu This is the 2nd video that clarifies how to keep your output window open in Visual Studio environment when you. /jesse-cook-mp3-free-download.html.
How To Keep Console Window Open In Dev C File
Feb 02, 2014 CPSC 3145 C 2nd semester at www.govst.edu This is the 2nd video that clarifies how to keep your output window open in Visual Studio environment when you have either cin input stream or no input. Dec 16, 2017 having two console windows in c application as the title suggests, i need to have 2 separate console windows in my application. One should be the 'main' console, and the other should be an independent one that has its own inout and output streams. I've read that it's possible to do it using WIN API by creating a new process. I've considered. Another option if you want to run the Debug version and not add crap to your code is to open the console window (Start - Run - cmd) and navigate to your Debug output directory. Then, just enter the name of your executable and it will run your debug program in the console.
How To Keep Console Window Open In Dev C Windows 10
P: n/a
> Add Console.ReadLine() at the end of Main. That will keep the console open
until you press the 'any' key. That's exactly what I was looking for. And I'm pretty sure I did the equivalent in Visual C++ years ago! That should be, until you press 'Enter'. Understood! Many Thanks, Richard 'Peter Bernhardt' <pe***@spammenot.com> wrote in message news:e$**************@TK2MSFTNGP11.phx.gbl.. That should be, until you press 'Enter'. -- Peter Bernhardt SharpSense Software LLC pe***@SharpBASSense.netURA 'Peter Bernhardt' <pe***@spammenot.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl..
Add Console.ReadLine() at the end of Main. That will keep the console open until you press the 'any' key. -- Peter Bernhardt SharpSense Software LLC pe***@SharpBASSense.netURA 'Richard Lionheart' <No***@Nowhere.net> wrote in message news:en**************@TK2MSFTNGP10.phx.gbl..
Hi All, When I create a Console app in VS.net and run it, the Console window opens briefly and closes. If I was running a .bat command file, I'd append a pause stmt at the end. What can I do in VS? I'm a newbie and keeping that window open would be helpful for studying. Thanks in advance, Richard