Results 1 to 2 of 2

Thread: ? operator

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    78

    ? operator

    Really quick, can someone tell me what the ? operator is?

    Thanks,
    AnT

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    ? isn't an operator. ?: is the ternary operator:
    Code:
    int x = 5;
    
    const char *greater = ( x > 4 ? "yes" : "no");
    Code:
    result = ( expr ? true-result : false-result);
    If expr evaluates to true, then the operator resolves as true-result, otherwise false-result.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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