Thread: Whats wrong with this program!?

  1. #16
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    since a is an int, you need to remove the ' ' around the numbers
    characters can be used in switches becuase they are stored as integers using the ascii code. So case '1': is the same as case 49:

  2. #17
    Registered User Sekti's Avatar
    Join Date
    Feb 2002
    Posts
    163

    ...

    you dont do this:
    Code:
    case '1':
    {
    //blah
    break;
    }
    you do this:
    Code:
    case '1':
    //blah
    break;
    +++
    ++
    + Sekti
    ++
    +++

  3. #18
    Registered User
    Join Date
    Dec 2001
    Posts
    206

    Red face oops

    sry lol yah hes right.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Maze Program - What am I doing wrong?
    By Gipionocheiyort in forum C++ Programming
    Replies: 20
    Last Post: 08-02-2007, 01:31 PM
  2. Replies: 5
    Last Post: 01-13-2007, 02:14 AM
  3. What is wrong with my code? My first program......
    By coreyt1111 in forum C++ Programming
    Replies: 11
    Last Post: 11-14-2006, 02:03 PM
  4. Whats wrong with this program - Output of a series
    By duffmckagan in forum C Programming
    Replies: 2
    Last Post: 07-26-2006, 09:57 AM
  5. Whats wrong with my program?
    By Ruflano in forum C++ Programming
    Replies: 5
    Last Post: 02-21-2002, 05:09 PM