Advertisement
EstEsca

system()

Oct 14th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. /* function system() example:
  2. system() makes a system call. To say easily, if you use function system("Command_in_Shell") like this, your programme will give a Command_in_Shell command to your shell during running.
  3. This example continuously makes a command "clear", so your screen will be cleared whenever the loop is made as if you command clear while you are on shell.
  4. */
  5.  
  6. #include <iostream>
  7. #include <stdlib.h> //standard library header, this includes function system()
  8. using namespace std;
  9.  
  10. int main(void){
  11.     int input;
  12.     while(1){
  13.     cout << "This programme just get input and input endlessly, Input: "
  14.     cin >> input;
  15.     system("clear");}
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement