Thread: What does this mean?

  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
    396
    "?:" 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
Website Security Test