Quote:Original post by Vidiki
Well, if the "choice" is above 3, I would like it to erase all previously written text, and run the code again.
Well, here's a brief discussion on that topic. (Short answer -- it varies from system to system, but if you're sticking with just one platform then there's probably a way to do it.)
My original point was regarding your else statements. Think about what would happen if you enter '3'. Is the else if (choice == 3) really necessary? In general, it is preferable for a function (even main) to have only one exit point. That is, don't return if you can just fall out of a loop and return at the end of the function.
And if, as I think is the case, you only want the program to exit when '3' is entered, I'd modify your while conditional -
int choice = 0;while (choice != 3){...}
This will allow inputs like '4' and '5' to be handled like every other "not allowed" input -- go back and start again.