Created
December 12, 2012 12:47
-
-
Save anonymous/4267472 to your computer and use it in GitHub Desktop.
This file contains 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(){ | |
unsigned char a = 255; | |
unsigned long int b = (a << 24); | |
unsigned long int c = ((unsigned long int) a << 24); | |
printf("b=%lu\n", b); | |
printf("c=%lu\n", c); | |
return 0; | |
} | |
cypreess@iMac ~ g++ f.cc -o f && ./f | |
b=18446744073692774400 | |
c=4278190080 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment