Skip to content

Instantly share code, notes, and snippets.

@leifwalsh
Created December 29, 2014 22:21
Show Gist options
  • Save leifwalsh/7037a68607775807ca6a to your computer and use it in GitHub Desktop.
Save leifwalsh/7037a68607775807ca6a to your computer and use it in GitHub Desktop.
int main(void) {
int x = 1;
int *y = &x;
return true ? x : y;
}
% g++ ternope.cpp
ternope.cpp: In function ‘int main()’:
ternope.cpp:4:17: error: operands to ?: have different types ‘int’ and ‘int*’
return true ? x : y;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment