cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Quick variable question
Quick variable question
Jul 19, 2013 at 8:07am UTC
Ryan Kalbfleisch
(7)
If I want to declare a int variable that will be used for user input. But I want to set parameters for what can be input into the variable how would I do that.
For instance:
int havingAHardTime; cannot = 0 and cannot be greater than 5
Jul 19, 2013 at 8:16am UTC
jrfrago
(83)
can it be negative?
ask the user again if (havingAHardTime == 0 || havingAHardTime >5)
Last edited on
Jul 19, 2013 at 8:19am UTC
Jul 19, 2013 at 8:29am UTC
Ryan Kalbfleisch
(7)
Thanks for the help, thats exactly what I did I just put it in a while loop.
Topic archived. No new replies allowed.