When I run my project using "Ctrl-F9", the output console pops up and instantly closes when my program terminates (i.e., at the return 0). How can I stop it? (Hint: saying "Use VC++" is not the answer ;))
Printable View
When I run my project using "Ctrl-F9", the output console pops up and instantly closes when my program terminates (i.e., at the return 0). How can I stop it? (Hint: saying "Use VC++" is not the answer ;))
why not put a system("pause") a getchar() or something in at the end?
I was thinking that they're be an option buried in the pile of options they give you. If I can't find one I'll just use getch() from conio.h. :(
I don't use Borland, so the tricky get-around is the only way I could come up with.
:)
:( I tried checking the environment options and didn't find anything obvious. :(
Might it be any one of these?
http://www.vbforums.com/attachment.php?s=&postid=584440
BTW, the third one didn't do anything. :(
Code:int ch = getche(); <<< - standard ploy - wait for user input
return 0;
is that the c++ builder 5.5?Quote:
Originally posted by filburt1
Might it be any one of these?
http://www.vbforums.com/attachment.php?s=&postid=584440
5.02
oh. yeah. i bought it a while ago, and i like it a lot. the visual editor i don't like that much because it is basically like vb, on;y instead of vbscript, it uses c++
Yeah, I find Borland's C++ IDE simple to use compared to the monstrosity of VC++.
About the problem...:confused:
what problem?
anyway, i hate the runtimes though
What runtimes?
well, if you use the visual editor, you need runtimes to run the program.
But this is console only. :)
oh, i see. i wish it didn't need the runtimes. :(
are you sure it doesn't need runtimes? because i thought i tried a console app once and it still needed them. try it on an old computer or something.
I'd install VMware but I don't have the CD with me and I'm not sure that it works in Windows XP. :(
Does "getchar()" work on Borland C++?
yeah
Then why not use that function to wait for a key before ending the program?
becaue filburts different:D
Try that, it waits for the user to hit Enter.Code:#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello"<<endl;
getchar();
return 0;
}
Btw, that's not a bug, that's the way it's supposed to be.
Non of them works for me on VC++, so I just use "cin>>" to wait for a key at the end.
abdul, I thought VC have the "press any key to continue" string before the console app terminate?
Dev C++ does not have so.
VC++ compiles the programs AS YOU WRITE THEM. It only adds the pause at the end when you run it from the IDE (it runs a separate program which spawns yours, then waits for input).
It worked, but I was hoping that they're be an option or something instead.Quote:
Originally posted by abdul
Does "getchar()" work on Borland C++?
oic.Quote:
Originally posted by parksie
VC++ compiles the programs AS YOU WRITE THEM. It only adds the pause at the end when you run it from the IDE (it runs a separate program which spawns yours, then waits for input).
Thank u.