Problem in the input

May 2, 2009 at 5:53pm
Hey there guys, I am facing a problem
I have successfully implemented my c++ code to manipulate a string,
but the problem is that I want my program to ask the user to enter a bunch of strings,the problem is that I want all those strings to be entered all at one time, with a space between each word, and if the user doesnt want to manipulate the word then he will just press enter.


The problem I am facing is that I dont know how could I possibly cin all those words together and store them, when I dont even know how many words the user will enter.

The other problem is that I dont know how to let the program break, when the user just presses enter???


If u could provide any help I would be really grateful ;)
May 2, 2009 at 6:19pm
You should probably just post in one forum. Clearly this is a beginner issue.
Last edited on May 2, 2009 at 6:20pm
May 3, 2009 at 8:54am
duplicate!!

anyway..

you can use getline() function for this problem. after getting the whole input, separate the words.
Topic archived. No new replies allowed.