I have a question about reading input from scanf.
The user enters one of two commands. Either a single worded command, or a two worded command separated by one space.
For example:
start
OR
begin program
I am trying to read from scanf. But I have a problem. If I do scanf("%s", input);
I am assuming he will enter only the one worded command.
If I do scanf("%s %s", input1, input2);
I am assuming he will enter a two worded command. But if he enters a one worded command, then the scanner will continuously consume white space until a different character is read.
For the two worded command I want to store each word in a separate string variable.
Please help.