On 22 Mar 2007 13:49:48 -0700 in comp.lang.c++,
wrote,
>I can see that cin has bad bit set to true after the first copy which
>it should be. But even after I called a cin.clear() before the second
>copy, I still couldn't get the program to try to read my second line
>of input into B.
Even after you call cin.clear(), the funky character is still waiting to
be read in the input stream. You need to do something to read it. My
favorite would probably be
std::cin.ignore(std::numeric_limits<std::streamsiz e>::max(), '\n');