Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Created July 14, 2017 00:55
Show Gist options
  • Save kaityo256/e1826050427619ed84edf385d4c971ff to your computer and use it in GitHub Desktop.
Save kaityo256/e1826050427619ed84edf385d4c971ff to your computer and use it in GitHub Desktop.
A sample using ternary operators
#include <iostream>
int
main(void){
int a = 2, b = 1;
auto x = (a > b? 2 : 1.0);
std::cout << x << std::endl; // => 2
std::cout << sizeof(x) << std::endl; // => 8
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment