Click to See Complete Forum and Search --> : Probably an easy one


mojoamonkey
January 31st, 2004, 01:35 AM
Hi,

Suprisingly, I can't find much information on the following:

cout << "Enter the container size (0.48/0.95/3.78/19): ";
cin >> canSize;

Now, say the user just hits enter. What I get is a dead cursor that will not do anything further.

I know this must be something with istream, but I'm not sure where to dig up the info.

Any help?

Thx

TDM
January 31st, 2004, 03:11 AM
Are you using a loop in the program after the cin statement?

TDM

kuphryn
January 31st, 2004, 09:48 AM
One solution is a loop. Another solution is to read in istream one line at a time via std::getline().

Kuphryn