switch(hexvalue???)

This is a discussion on switch(hexvalue???) within the C Programming forums, part of the General Programming Boards category; Dear all, can i use hex value with switch() statement?? eg:- variable1; // 2 byte hexvalue switch(variable1) { case 0x0000: ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    17

    switch(hexvalue???)

    Dear all,

    can i use hex value with switch() statement??
    eg:-

    variable1; // 2 byte hexvalue

    switch(variable1)
    {
    case 0x0000:

    case 0x0001:

    }

    thanks
    cool

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yes. You really should try things on your own. It's amazing what you can learn...

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    >>can i use hex value with switch() statement??
    Yes, hex literals count as an integral constant in most circles...like the world. :-)
    *Cela*

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