?

Log in

No account? Create an account
penrose orange

stephenw32768


/var/log/stephen

cat /var/log/stephen >/dev/eyes


sizeof(int) <= sizeof(long)
penrose orange
stephenw32768
Simple program to display the sizes of various data types:
#include <stdio.h>

int main(void)
{
  printf("Size of int: %d bytes\n", sizeof(int));
  printf("Size of long: %d bytes\n", sizeof(long));
  printf("Size of long long: %d bytes\n", sizeof(long long));
  printf("Size of pointer: %d bytes\n", sizeof(int *));
  return 0;
}


Native 64-bit mode:
[thalassa./tmp] gcc sizes.c
[thalassa./tmp] ./a.out
Size of int: 4 bytes
Size of long: 8 bytes
Size of long long: 8 bytes
Size of pointer: 8 bytes


32-bit compatibility mode:
[thalassa./tmp] gcc -m32 sizes.c
[thalassa./tmp] ./a.out
Size of int: 4 bytes
Size of long: 4 bytes
Size of long long: 8 bytes
Size of pointer: 4 bytes