I'm a little new to C++, so sorry if this question is obvious, but I've hit a bit of a roadblock. The thing I want to do is have a command prompt that does certain things. You put in simple commands like timer down 10
which will start a timer count down which I have done fine. The way I'm detecting for each word is with this:
string cmd1;
string cmd2;
int cmd3;
cin >> cmd1 >> cmd2 >> cmd3;
That works fine, except I want to have single-word commands and with this system, I can't really do that. If I want, for example, help
as a command, its making me type 2 strings and an int when I only want to type 1 string. But I want to have specific commands that can be the full 2 strings and an int or just 1 string.