The problem I'm having is that when it compiles and I put my name as Mr S. Swanepoel, and go to next line it gives it as address 1: address 2: postalCode; in stead of
address 1:
Address 2:
PostalCode:
By same way, do you mean does it work the same way as std::cin? Not quite. std::istream::getline() extracts characters (including white-space) from the input buffer. It will keep extracting until either the specified number of characters have been successfully extracted, or until the newline character is found.