Skip to content
How to return to another line of code in c++
Profile icon
BFDMod

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!)

You are viewing a single comment. View All
Profile icon
Geocube101

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 }
Profile icon
BFDMod

@Geocube101
I'll give that a try! It does look like it can fix my problem, thanks for your time and effort!

Profile icon
Geocube101

@BFDMod
You're welcome