[vox-tech] Size of long int?

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sat Jan 9 00:52:09 PST 2010


Brian Lavender wrote:
> It seems that long int on 32 bit is 4 bytes on my 32 bit machines with
> gcc and on my 64 bit machine is 8 bytes.
> 
> There is no standard on long int, is there? 
> 
> #include <stdio.h>
> 
> int main()
> {
>    printf("Size of int is %ld\n",sizeof(long int));
>    return 0;
> }

Welcome to Standard C, Brian.  Not only is there no standard number of bits
for long int, there is no standard number of bits for any data type (though
char is usually 8 bits).

-- 
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------


More information about the vox-tech mailing list