|
c++ ternary operator...
this category is lagging .. so i thought i'd post something cool i learned in c++
the ternary operator ( ? : )
(condition 1) ? (expression 1) : (expression 2 )
so .. if condition 1 is true, then use expression 1 .. else use expression 2
whatFruitToBuy = ( i like apples ) ? buy apples : buy grapes;
anyhow .. just saves some if/else statements.
|