Hello, i'm rather new to C++ and i was trying to take a string of input and divide the string into an array of words.
I tried using this bit of code. getline (cin, item, ' ');
The only problem with this code is that it simply ignores the last word of the string or so i think anyway. Like I said, I am very new to this. Is there any other way of breaking a string of input into an array of words?
That accepts two variables from the user, input1 and input2. cin will input data into input until a space or line return is entered. This seperate your string into two variables as long as there is only one space between the two values.