return to the main()

This is a discussion on return to the main() within the C++ Programming forums, part of the General Programming Boards category; I have a main program with a switch statement, and each case pulls up a function which is a program, ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    33

    return to the main()

    I have a main program with a switch statement, and each case pulls up a function which is a program, how, once the function is run, go back to the main program? So like if the program asks me what I want to do, and I say I want to goto a calculator, and then I finish adding my numbers, how do I go back to the program and be able to pick a different choice, like a game.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,220
    Code:
    int main(void)
    {
     while(1)
     {
      switch(blah)
      {
       blah blah
      }
     }
     return 0;
    }

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    Put your switch in a loop controlled by user input.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to combine these working parts??
    By transgalactic2 in forum C Programming
    Replies: 0
    Last Post: 02-01-2009, 07:19 AM
  2. Another weird error
    By rwmarsh in forum Game Programming
    Replies: 4
    Last Post: 09-24-2006, 10:00 PM
  3. DirectInput help
    By Muphin in forum Game Programming
    Replies: 2
    Last Post: 09-10-2005, 11:52 AM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. Algorithm to walk through a maze.
    By Nutshell in forum C Programming
    Replies: 30
    Last Post: 01-21-2002, 12:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21