Re: Stopping command window from closing
From: Chris Schumacher (kensu___at_hotmail.com)
Date: 02/25/05
- Next message: Jedispy: "Re: C++...and I'm stumped!"
- Previous message: Alf P. Steinbach: "Re: Calling main."
- In reply to: Gareth: "Stopping command window from closing"
- Next in thread: Mark P: "Re: Stopping command window from closing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 25 Feb 2005 04:11:05 GMT
"Gareth" <hotmail.com@dgareth.spm> wrote in
news:421e5890$0$23945$ed2e19e4@ptn-nntp-reader04.plus.net:
> I'm trying to learn c++ with Borland C++ Builder 6.
>
> It seems to be a fairly straightforward program to use using the
> "console wizard" for basic c++ textbook lessons
> (File>>New>>Other>>Console Wizard).
>
> But why do I need to insert the following line of code in to the
> source to prevent the XP command window from closing?:
>
> std::cin.get();
>
> Why doesn't the window automatically remain open and wait for a
> closure click to close?
>
> Gareth.
You need it to pause before the window closes. C++ is meant to be run
from a command prompt.
For windows the line is: system("pause");
I don't know what it'd be on a Unix system.
obAnsi: this solution is not ANSI compliant.
-==Kensu==-
- Next message: Jedispy: "Re: C++...and I'm stumped!"
- Previous message: Alf P. Steinbach: "Re: Calling main."
- In reply to: Gareth: "Stopping command window from closing"
- Next in thread: Mark P: "Re: Stopping command window from closing"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|