Ah-hah...what you've discovered is the difference between cin and getline. You see, when determining what value has been typed in, cin uses all whitespace to separate values. Whitespace includes, well, the space character ' ' and the newline character '\n', among other things. You know when you hit the space bar, you create a ' ' character, and a '\n' is generated when you press enter. Unfortunately, this means cin can only get 1 word in a string at a time. To get the whole thing, you need to use getline.
getline is a function of this form:
- getline(inputStream, yourStringVariable);
inputStream in this case is cin, and yourStringVariable will be address. getline will retrieve all text from the point at which inputStream begins until the next '\n' - this includes the space character!
The only problem you might encounter is any leftover '\n' from your previous inputs, since the regular cin >> calls may have left a '\n' in the stream. In that case, getline immediately sees the '\n' and thinks it is done. To avoid this problem, you need to use the following statement just before the getline statement:
This will discard either 100 characters from the input stream or discard characters until a '\n' is found, whichever comes first. This will clear the stream so that you can properly retrieve the address.
Hope that helped!