Created
May 11, 2013 01:47
-
-
Save scvalex/5558601 to your computer and use it in GitHub Desktop.
An example to illustrate the surprising precedence of `<<` in action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
printf("1 << 1 + 2 = %d\n", 1 << 1 + 2); | |
printf("1 << 1 * 3 = %d\n", 1 << 1 * 3); | |
printf("1 << 1 + 1 << 1 = %d\n", 1 << 1 + 1 << 1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build and run: