*gulp*

This is a discussion on *gulp* within the C++ Programming forums, part of the General Programming Boards category; hello again!
another silly problem ... i need to ask the user to enter a number. Checks to see whether ...

*gulp*

hello again!

another silly problem ... i need to ask the user to enter a number. Checks to see whether the number is between 1 and 5 inclusive. If the number is valid then the function returns the number. If the number is invalid then the user is asked to re-enter a number.

simple enough, but i'm lost. i need to use a do while loop... right?

--

... you know when u leave everything to the last minute and then think, "gee, i wish i hadn't left everything till the last minute"

loop:
prompt for number
check number
if number ok
return number
goto loop; /* ;) */

You just need to break your program up into tiny steps. Then break each step into another step. Repeat that until you have the simplest steps possible. Turn that into code. If you're going to play programmer, you have to actually think. It helps too, if the things you're thinking about actually relate to the task at hand.