[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

sizeof(long) (was: Re: looking for fix to AMD64 python dl problem....)



Hello Roberto.

Roberto C. Sanchez, 18.02.2007 00:37:
> If you run this program on an amd64 machine:
> 
>   $ cat sizes.c 
>   #include <stdio.h>
> 
>   int main(void) {
>     printf("int: %d; long: %d; char *: %d\n", sizeof(int), sizeof(long), sizeof(char *));
>     return 0;
>   }
> 
> This is what you get:
> 
>   $ ./a.out 
>   int: 4; long: 8; char *: 8

Huh? I always thought long would always be 4 bytes whereas the size of int would
depend on the architecture (2 byte on 16bit, 4 byte on 32bit, …). Did I get
something wrong?


Regards, Mathias

-- 
debian/rules

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: