Skip to content

Instantly share code, notes, and snippets.

@rssh
Created April 27, 2012 06:19
Show Gist options
  • Save rssh/2506418 to your computer and use it in GitHub Desktop.
Save rssh/2506418 to your computer and use it in GitHub Desktop.
example of werid print behaviour for Peter
#include <stdio.h>
int main(int argc, char** argv)
{
printf("sizeof(int)=%d, sizeof(long)=%d, sizeof(long long)=%d\n", sizeof(int), sizeof(long), sizeof(long long));
long long check[3];
check[0]=1;
printf("x1=%d, x2=%d, x3=%d\n", check[0],check[0],check[0]);
return 0;
}
@rssh
Copy link
Author

rssh commented Apr 27, 2012

$ gcc x.c 
$ ./a.out 
sizeof(int)=4, sizeof(long)=4, sizeof(long long)=8
x1=1, x2=0, x3=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment