Help for this page

Select Code to Download


  1. or download this
    config = ''
    fred = 42
    fred == 42 ? config = 'k1' : config = 'k2'
    print "config=#{config}\n"
    
  2. or download this
    <?php
    $config = '';
    ...
    $fred == 42 ? $config = 'k1' : $config = 'k2';
    echo "config=$config\n";
    ?>
    
  3. or download this
    #include <stdio.h>
    int main()
    ...
       printf("config=%d\n", config);
       return 0;
    }
    
  4. or download this
       fred == 42 ? (config = 1) : (config = 2);  // this works
       fred == 42 ?  config = 1  : (config = 2);  // also works
       fred == 42 ? (config = 1) : config = 2;    // syntax error