Thread: return to the main()

  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,212
    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, 08: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, 01:54 AM