I have made this program, It get the users adress, name and work. Then It puts it all into one string and outputs that string. (I know there are better ways to do this)
cin.getline(name,10); reads at most NINE characters from the input, stopping earlier if there's a newline. If there's no newline in those 9 characters, it won't touch the rest of the line, and the next call to getline will continue reading the rest of the line.
If you want to just ignore the rest of the input line, you could instead use:
cin.get(name, 10);
cin.ignore(INT_MAX, '\n');