dumb if and case stuff...

This is a discussion on dumb if and case stuff... within the C++ Programming forums, part of the General Programming Boards category; I'm sure this will be simply for most people here..when I'm using if statements or switch case, how can I ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    dumb if and case stuff...

    I'm sure this will be simply for most people here..when I'm using if statements or switch case, how can I make it use a char as the input. when ever I try to use a letter instead of a number it says "undeclared identifier" Can you please keep it fairly simply, I really don't know much about C++...I'm using microsoft visual C++

  2. #2
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    maybe this will help
    when you compare a variable with an char you should place the char between ' '
    like this:

    if(input == 'a')

    I hope this is what you mean.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    Thumbs up

    cool, that was it. Thanks simple too

Popular pages Recent additions subscribe to a feed

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