Console Apps.

M

Mike Wahler

TheIntelkid said:
Is there an equivalent for SYSTEM("PAUSE") for borland c++ builder 6?

Note that C++ is case sensitive. The function's
name is 'system()'. The 'equivalent' is to use
exactly the same thing:

system("PAUSE");

(Assuming your host platform provides a "PAUSE"
command, and that it does what you need.).

'system()' is a standard function. Its argument
is platform-dependent, not standardized.

-Mike
 
M

Michael Bruschkewitz

system("PAUSE");

(Assuming your host platform provides a "PAUSE"
command, and that it does what you need.).
That's the point. But this is an OS-issue, so it's sligthly off-topic
here.
Anyway, although system() is required to pass the parameter to the
command interpreter (at least, msvc-help and solaris-manpage says this),
I already experienced problems with implementations where system() tried
to execute the command as executable, what fails if command is an
internal one (as "PAUSE" is). But I can't remember which OS this was.

But I don't know why system("pause") should be necessary.

Regards,
Michael B.
 
D

David Lindauer

Michael said:
That's the point. But this is an OS-issue, so it's sligthly off-topic
here.
Anyway, although system() is required to pass the parameter to the
command interpreter (at least, msvc-help and solaris-manpage says this),
I already experienced problems with implementations where system() tried
to execute the command as executable, what fails if command is an
internal one (as "PAUSE" is). But I can't remember which OS this was.

as the other poster pointered out, just *having* a system function is
required, but what it does is implementation defined. So while on that OS
it doesn't seem that it does the most useful thing, it is
within its bounds to do it that way.

David
 
T

Thomas Matthews

TheIntelkid said:
Is there an equivalent for SYSTEM("PAUSE") for borland c++ builder 6?

There are other alternatives:
cout << "Paused, press ENTER to continue." << endl;
cin.ignore(10000, '\n');

But these alternatives depend on what you want the program
to do while "pausing". Some operating systems provide some
sleeping calls so that you can have your program sleep until
some event happens, such as expiration of some time duration
or an external event such as a keyboard press. All these are
system dependent and best discussed in a newsgroup about
your operating system.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top