I am trying to create a word parser that will split a sentence into it's individual words so I can then interpret meaningful words into commands. This is what I have so far.
Although you didn't really state what the problem is, I took the liberty of finding it for you. The problem arises from the way you are reading the sentence. The istream '>>' operator stops reading input when it encounters a white space character (space, newline, tab, etc); this means that if you had a long sentence as input, line 7 will only read the first word of the sentence.
Now with this in mind, do you see a way of using this behaviour to your advantage rather than running to the getline function?
To address you second post, the reason it is not storing the word (remember it only reads first word before a space character) is because of your if statement on line 19. Since the word it reads does not contain a white space character, the word is never stored in the array