Guest User

Untitled

a guest
Jan 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. return (condition ? x : y);
  2.  
  3. if (a == b && c == d) // AVOID!
  4. if ((a == b) && (c == d)) // RIGHT
  5.  
  6. return (someBoolean ? x : y);
  7. return ((x > y) ? x : y);
  8.  
  9. int foo = (bar > baz) ? bar : baz;
  10. int foo = (someBoolean) ? bar : baz;
  11.  
  12. int foo = (bar > baz) ? bar : baz;
  13.  
  14. int foo = (someBoolean) ? bar : baz;
  15.  
  16. int foo = bar > baz ? bar : baz;
Add Comment
Please, Sign In to add comment