I am programming in c++ and making a food ordering app, first it shows the menu, then you pick something, then I want the program to to return to the line of code that shows the menu and you input what else you want.
For example if I had 100 lines of code, perimeters were met at line 80 to go back to line 8, how would I do that? Please answer if you can so I can finish this project! (sorry if my problem did not make sense to you!)
It is possible to place all of the code you need to rerun inside of an infinite while loop (with a specific condition to break the loop when necessary)
//Setup code here
while (true)
{
//Looped Code Here
}
How to return to another line of code in c++
I am programming in c++ and making a food ordering app, first it shows the menu, then you pick something, then I want the program to to return to the line of code that shows the menu and you input what else you want.
For example if I had 100 lines of code, perimeters were met at line 80 to go back to line 8, how would I do that? Please answer if you can so I can finish this project! (sorry if my problem did not make sense to you!)
It is possible to place all of the code you need to rerun inside of an infinite while loop (with a specific condition to break the loop when necessary)