Guest User

Untitled

a guest
Oct 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;    
  5.  
  6. int main()
  7. {
  8.         string command;
  9.         char * szcommand;
  10.  
  11.         while(true)
  12.         {
  13.                 cout << ">";
  14.                 cin >> command;
  15.                 if(command == ""){return 0;}
  16.                 szcommand = new char[command.length() + 1];
  17.                 strcpy(szcommand, command.c_str());
  18.                 system(szcommand);
  19.                 delete [] szcommand;
  20.                 cout << endl;
  21.         }
  22.         return 0;
  23. }
Add Comment
Please, Sign In to add comment