Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created March 10, 2011 01:42
Show Gist options
  • Save wjlafrance/863422 to your computer and use it in GitHub Desktop.
Save wjlafrance/863422 to your computer and use it in GitHub Desktop.
Using a weird assignment / conditional
#import <stdio.h>
int main() {
int value = 0;
if (5 == (value = thisReturnsFive())) {
printf("It works!\n");
} else {
printf("It doesn't work!\n");
}
return 0;
}
int thisReturnsFive() {
return 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment