What does this mean?

This is a discussion on What does this mean? within the C Programming forums, part of the General Programming Boards category; This is probelry a really daft question but can anyone point me in the direction of the followling piece of ...

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    61

    What does this mean?

    This is probelry a really daft question but can anyone point me in the direction of the followling piece of code

    Outcome= (First<= Second) ? First : Second;

    all are shorts

    thanks

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    395
    "?:" is the only ternary operator in C. It is equivalent to "if(first <= second) outcome = first; else outcome = second;"

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