The 2nd one's better. Cin will enter a failstate if a non-integer is typed. If it's not a failstate, then it had an integer. If that integer is >= 0 && < 10 (my bad, I didn't check for a negative in the code) then it must be a single digit, right? :)programmerinprogress wrote:@ MarauderIIC, Now I know 8-), that's actually is a much better way of doing it, no code duplication at all!
JForce vs. GyroVorbis
Moderator: PC Supremacists
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: JForce vs. GyroVorbis
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.