--- In [email protected], "Brett W. McCoy" <[EMAIL PROTECTED]> wrote: > > On 5/13/07, ajinkyakale_86 <[EMAIL PROTECTED]> wrote: > > > Why is it that some compilers allocate 2 bytes for "int" > > (eg: turboC) and some allocate 4 bytes(eg: VC++ visual studio) > > It's dependent on the OS -- Turbo C is targeted for 16-bit > operating systems (i.e., MS-DOS) whereas VC++ is targeted > for 32-bit (or higher) operating systems. > > -- Brett
In addition, the ANSI standards don't impose too much restriction on those data sizes; in fact you can as well find some platforms where sizeof( int) == 8. And I'm pretty sure you will also find architectures where sizeof( int) == 6; and in a few years you will also find sizeof( int) == 16. In other words: whatever the compiler writers considered useful Regards, Nico
