***How Do I Return To The Beginning Of My Program?***

I have a program, many pieces. Well, many for me as a newbie.

-It prompts the user for a choice.
-The User puts in the choice.
-The program runs and compiles fine -
-But instead of a return 0;
-how would I return to like - my first cout prompt?
-or is goto the correct way ahead here?


1
2
3
}
  return 0;
}
Put your code in a loop.

1
2
3
4
5
6
int main() {
  bool quit = false;
  do { // enter main loop
    // your code here  
  } while(!quit);
}


Last edited on
Topic archived. No new replies allowed.