Hi,
I'm having trouble as to why my code continues after my while loop when the loop is placed in main, but when I place the loop in a void function, if the while loop fails and is then successful in a subsequent loop, my code terminates?
The while loop is meant to be used as a input limiter
If you exited the loop, your function is over, and there are no more instructions in your program, so it's also over. Why would it do anything but that?
Perhaps show an example of code that does what you expect, and code that doesn't do what you expect.
Edit: you edited your OP after I made this post.
Edit: You also edited your OP again after Repeater's post. Just in case other readers are confused.
Perhaps show an example of code that does what you expect
You have to write all the code you want into your program.
I intentionally left out the code (if statement) as I would have to include several other lines of code for comprehension but I have now edited it to briefly show what I'm trying to get at.
The second block of code continues to run the if statement after the while loop has exited, while the first block of code exits completely after the while loop.