In the code below, I tried to let the user input text, and it would output the first word. However, whenever I try the program to input the text, it doesn't output anything.
Note that if you are using the program interactively, you need to signal end-of-input by entering Ctrl-D (Ctrl-Z on windows) at the terminal. If you don't, it'll just keep waiting forever for more input.
How did you arrive at the conclusion that push_back is the problem?