Is there anyway to get Dev-C++ to automatically run a program with a pause at the end of execution instead of having to manually type in the line of code for a pause?
Printable View
Is there anyway to get Dev-C++ to automatically run a program with a pause at the end of execution instead of having to manually type in the line of code for a pause?
Dev C++ automatically puts in Pause("SYSTEM") at the end
No it doesn't. I have to type the line in before the return statement or it finishes execution without letting me see the console window.
What version of Dev-C++ do you use?
4.9.9.2
is that one of teh version 5 betas?
I use version 4 which gives me system ("PAUSE")
Yeah it's a beta
Ok maybe they got rid of making it show that at the bottom.
Any suggestions as to any editors that I can use that do this that aren't propritary? (i.e. MSVC++)
Dev-C++ is a good IDE, I'm not sure you need to leave it over such a small issue. Besides, pausing the program at the end is only something a small number of users actually want to do, so it shouldn't be a surprise that the IDE doesn't do it for you, especially when it is so easy to add it to the program yourself.
put it in yourself if you want it in there. and useinstead of system("PAUSE");Code:std::cout<<"Press [ENTER] to continue\n";
std::cin.get();
The best editors/compilers don't put a pause in there IMO.
There's an FAQ on this subject: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
First, you can change the code that is automatically given with any new source code page:
Tools -> Editor options -> Code tab (at the top) -> Default Source tab (near the bottom)
Put in something like:Then, when you create a new source code file, that should be ready for you, instead of typing those horrible 16 characters over and over and over and over again!Code:#include <iostream>
int main()
{
//your pause code here
return 0;
}
Or, presuming you run Windows [edit]and only want it to stay open during testing[/edit], click on start -> run and type cmd. Change the directory to the one containing what will be your executable, and run it from there after you compile. When the program is complete, the shell will stay put.