Need help with C programming

Discussion in 'Computer Games and General Discussion' started by Feels Good Man, Oct 15, 2010.

Oct 15, 2010
  1. Feels Good Man
    OP

    Member Feels Good Man GBAtemp Advanced Maniac

    Joined:
    Apr 15, 2007
    Messages:
    1,643
    Country:
    Canada
    What's the proper format to put a switch statement inside a while statement so that if you dont input a correct number specified, it'll ask you to input a number again?

    I did something like this:
    http://pastebin.com/GR37c4UB

    Is that correct? It doesn't seem to work properly when I add more stuff to this program im trying to make >__>. It totally skips that while statement and just goes to the next category.
     
  2. gotchapt

    Member gotchapt GBAtemp Regular

    Joined:
    Sep 6, 2009
    Messages:
    159
    Country:
    Portugal
    it skips the while() because choice is not yet initialized between 1 and 4
     

Share This Page