| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
curious about switches
At end of my prog I want a line that says "Do Again.....(Y/N)......"
I am thinking that a switch afterwards is the way to do this. Now I am trying to figure out how to make the switch (when Y or y is entered) return to the beginning of the prog and rerun the whole thing. I am pretty much stumped...if anyone can help thanks in advance... -Lazerous357 ![]() |
|
#2
|
|||
|
|||
|
Basically you will need some code in the form -
again = true; while (again) { // do code // ask question // if 'y' again = true // if 'n' again = false } Hope this helps, -KM- |
|
#3
|
|||
|
|||
|
Hey thanks for the response KM
lol I had decided to chunk the switch and go for a do/while instead. Glad to see you suggested it also, makes me think I am on the right track. Think I almost got it now : ![]() -Lazerous357 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > curious about switches |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|