- Code: Select all
using namespace std;
cout << "Enter you address" << endl;
//with a delimiter specified
cout << "You are residing at " << address << endl;
this is a piece of code i got from http://cplus.about.com/library/weekly/aa030702a.htm.
When I tried out this code, I entered:
555 Elm St.
then hit enter.
Nothing happens after i hit the first enter.
I hit enter again for a 2nd time...
the output finally comes out: " You are residing at 555 Elm St."
How do i fix it so that I only have to press enter once? I tried specifying the delimeter to be \n but same results occurred.