I am writing a game. The game will be controlled by the cmd, it is like a hacking game. You type: run exploit545.exploit www.tktktk.switchnet and it will exploit that exploit at the targeted computer (url). My problem is i cant seem to find a way to make the program read only the first words and then detirman what it should do, then read the other words and detriman to who it should do it. So bassicly i need to make a program that will read the line the user enters, then put each word, either in a array or into a new string so that it can determan what to do better (Almoust like putting it into a keyword). It will be like the cmd or terminal (for the linux users).
if you use command line arguments eg:
int main(int argc, char *argv[])
you can say which word is going to be used eg:
if(argv[1] == "Hallo")
cout<<"Hallo Man";
But my program isnt going to use command line arguments, the user is going to enter it in the program itself
Here are a few more egsamples if you didn't understand what i said because i dont know how to say it :(
int nmap(string line1, string line2);
int main(int argc, char *argv[])
{
if(argv[1] == "nmap")
{
for(int i = 2; i < 10; i++)
{
nmap(argv[i]);
}
}
}
that program takes in command line argumenst, mine is suppose to only take in user inputs.
but i get and error if i try to make the user inputs something like that.
Thanks....