c++ help please?

Associate
Joined
4 Mar 2016
Posts
65
Location
Glasgow, Scotland
I'am trying to wright a simple program that has a use enter a cmd command i was told system would be cmd... but it dose not like the vars but could i use cin >> system or some thing similar to that? thanks Joshua code --->
#include "iostream"
#include "windows.h"
#include "string"


int UseCmd; // used for a varibal for user to continu using cmd
char command; // cmd command
using namespace std;
int main()
{
cout << "Thanks for using Use commands for cmd it is By Joshua \n";
Sleep(10);
cout << "Josh is not responsible for any damages you cause and by using this you agree to this. I will also not tell you any commands so if you dont understand cmd leave... \n and by continunig then you agree to these conditions \n\n";
Sleep(10);
cout << "1 to use Cmd well 2 will close cmd. using anything else will not work because this is only the first build. \n It is also my first real program \n\n"; // \n is used for new line
cin >> UseCmd; // used for colectin 1 or 2 for cmd
while (UseCmd < 1); // usedc to check if below 2 aka see if it is one
{
cout << "What command do you want to run? \n"; // ask use for command
cin >> command;
Sleep(100);
system("COLOR 2");
}

if (UseCmd > 2) {
cout << "thanks for using Use commands for cmd. \n";
Sleep(500);
exit;
}
return 0;
}
 
Back
Top Bottom