Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Last active July 14, 2017 04:47
Show Gist options
  • Save kaityo256/134008c8717a4b1ca00d334701c16a21 to your computer and use it in GitHub Desktop.
Save kaityo256/134008c8717a4b1ca00d334701c16a21 to your computer and use it in GitHub Desktop.
A sample using ternary operators
#include <iostream>
int
main(int argc, char ** argv){
(argc > 1? std::cout:std::cerr) << "Hello" << std::endl;
}
@kaityo256
Copy link
Author

$ ./a.out > /dev/null
Hello

$ ./a.out 1 > /dev/null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment