Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Simple C++ error checking question

Name: Anonymous 2007-04-30 12:51 ID:xTzKP01J

I bet the answer to this is simple and I'm simply too stupid to figure it out.

I have a program that is asking for a number in the range of 1-8. I do not want to allow the user to enter strings. What is a short and clean way to only allow ints to be entered?

Name: Anonymous 2007-04-30 13:25 ID:VqPPBGqi

if(number == int) then continue;
else ERROR, REPEAT;

Name: Anonymous 2007-04-30 16:34 ID:Heaven

>>2
That code sucks, though. You could have easily included at least the words `convergence' and `assimilation' in it.

Name: Anonymous 2009-01-14 14:45

Turing

Name: Sgt.Kabu頮挹kimanఛ঄ 2012-05-29 1:03

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List