Whats wrong with this program!?

This is a discussion on Whats wrong with this program!? within the C++ Programming forums, part of the General Programming Boards category; since a is an int, you need to remove the ' ' around the numbers characters can be used in ...

  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.

Page 2 of 2 FirstFirst 12
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, 01: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, 01: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, 04:09 PM

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