multiple char inputs in a sentence

i have to write a program where you enter:
name
age
city
profession
....and then those are inserted into a sentence. well after the first cin.get(); it just prints out the remaining cout's and ignores the other cin.get's. how do i fix this
It's probably because when you use cin>> to read data, it leaves a newline from when the user pressed enter. cin.get() reads that and it moves on without seeming to wait. You can use cin.ignore() before cin.get() to throw away any leftover input.
Topic archived. No new replies allowed.