• Welcome to Computer Association of SIUE - Forums.
 

help on some c++ code

Started by Rick Lynch, 2007-09-24T19:03:24-05:00 (Monday)

Previous topic - Next topic

William Grim

Just in case you didn't see it, the code I posted had the solution in it:


cin.clear();
cin.unget();
William Grim
IT Associate, Morgan Stanley

Rick Lynch

Yeah, for some reason that did not work when I tried. I don't know why.
Rick Lynch - Junior
Applied Mathematics Major
(Don't let this fool you. I love CS as well!)

William Grim

There are some quirks in each compiler then.  I tried my code on VS.NET and found it didn't work.  However, this is guaranteed to work on VS.NET and g++:


cin.clear();
cin.unget();
cin.clear();
William Grim
IT Associate, Morgan Stanley

Tony

I am not sure if this was just a typo or what, but recker said he tried "cin.clear()" and "cin.get()" not "cin.unget()".  

NOTE: there is a UN before get
I would rather be hated for doing what I believe in, than loved for doing what I don't.

Rick Lynch

haha, no it wasn't a typo... dumb mistake. It probably would have worked then. Crap! I'm sorry.
Rick Lynch - Junior
Applied Mathematics Major
(Don't let this fool you. I love CS as well!)