I'm working on a problem in a chapter that's about C-strings, strings, and vectors. It seems the problem wants me to solve it using a C-string or two since it's problem 1 and corresponds with how the chapter starts out on C-strings.
Anyway, I'm trying to understand what's going on when, for example, I'll have something like
and if I enter more than the stream size count (e.g., more than 9), the stream doesn't clear and input will be an endless sequence of a character static_cast<int>(input) of "-52." This is what I'll get with Visual C++ 2010, and with Code::Blocks something similar will happen where the stream doesn't seem to clear even if I try to have it cleared manually.
Thank you, webJose. . . but sadly, I'm not getting that to work either, although I'm sure it should. The outcome is the same. I even tried other valid arguments for cin.ignore. There's really nothing else to the program currently so I don't know why I'd be having such an issue.