Results 1 to 5 of 5

Thread: Select Case

  1. #1

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Question

    Is there a "select case" and "case..." thing in c++?

    thx [COLOR=skyblue][COLOR=skyblue][COLOR=skyblue]
    Amon Ra
    The Power of Learning.

  2. #2
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    Talking Switch Statement. (It's the same)

    Here is an example

    Code:
    switch(expression)
    {
    case ValueOne:  statement;
                                               break;
    case ValueTwo:  statement;
                                               break;
    default:               statement;
    }

    There ya go.
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  3. #3

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    Wink Cool

    Yep it works, thanks a lot
    Amon Ra
    The Power of Learning.

  4. #4
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Make sure you remember to put a break statement after each case. If you don't then the code for every case after the one that was true will be executed, which is usually a fairly bad thing
    Harry.

    "From one thing, know ten thousand things."

  5. #5

    Thread Starter
    Hyperactive Member Amon Ra's Avatar
    Join Date
    Feb 2001
    Location
    In some cave on Uranus...
    Posts
    500

    :)

    Ok cool. thanks a lot.
    Amon Ra
    The Power of Learning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width