Skip to content

Instantly share code, notes, and snippets.

Created December 12, 2012 12:47
Show Gist options
  • Save anonymous/4267472 to your computer and use it in GitHub Desktop.
Save anonymous/4267472 to your computer and use it in GitHub Desktop.
#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