954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

System() Function: Info on uses & Description

The System () function call is in C and C++, but I can't seem to find out just
exactly what it can do. I use "C++ How to Program", by Deitel and Deitel, but it's silent on the application of System(). Any help would be appreciated.
Thanks.

PS:
For example, I stumbled on this application:
system ("pause") // causes program to pause before a return to keep interactive text on the display screen.

CPLUSCPLUS
Newbie Poster
6 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

With system() you can access any old DOS command
(if you are using Linux, any old Unix command).

#include
...
system("CLS"); // the much debased clear screen
system("PAUSE"); // wait, the hard way
system("DIR"); // list the directory
... and so on!

Not recommended if you want to have portable code!!!!

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

vegaseat,
Thanks for your datapoint! It sheds much light on the subject to an old :D 'dos' user. Also, can you tell me where this data is documented?
Thanks again, and have a great and safe holiday season.
CPLUSPLUS
*******

With system() you can access any old DOS command (if you are using Linux, any old Unix command).

#include ... system("CLS"); // the much debased clear screen system("PAUSE"); // wait, the hard way system("DIR"); // list the directory ... and so on!

Not recommended if you want to have portable code!!!!

CPLUSCPLUS
Newbie Poster
6 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You