// system.cpp - Demonstrating system calls /* Microsoft Visual C++ 5.0 (Win32 Console App) example. Execute a command. The system function passes command to the command interpreter, which executes the string as an operating-system command. include file: syntax: int system( const char *command ); */ #include // for system() #include // for getch() #include void main() { // The following does not appear, because the output // stream is not flushed before calling system: //cout << "Press any key to clear the screen:"; // The following works correctly: cout << "Press any key to clear the screen:" << endl; getch(); system("cls"); cout << "Here is some more output." << endl; }