I have this problam and can't seem to figure it out. The following:
The program I am trying to make is a quiz of some sort. It asks a question, then it compares the answer for the right answer and if the answer is white-space line it gives a next clue and if its wrong it gives the next question.
Anyways can't figure out how to make it figure the white-space line.
And if right answer is "correct" and you answer "c orre ct" it should still be fine. Any idea?
Read the input into an std::string A, then create another string B. For every char of A, if it is not ' ', push it to B. Now if A was "a b ", B is "ab". If A was " ", B is "", so just compare B to "". If you consider no input different from entering a space, then skip this check if length of A is 0.