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
Answered by Geocube101 [earned 5 cycles]
View Answer
Profile icon
[deleted]

@AquaMarine0421
do not advise a new programmer to use GOTO statements. you do not want to touch that spaghet. There is only one case where it can be required in C, when you need to escape multiple nests of a for loop. Outside that, there is almost guaranteed to be a better way to write code.