# Re: What is the size of an integer in Turbo C and Visual C++ and in linux ??

OK.. thanks.. my meaning of asking why was like i was thinking that being 32
bit integer in VC++, still we get 32767 as the max value it can hold.. but
you clarified my doubt... Thanks..

So, in VC++ 6.0 or onwards (mean in 32 bit os..) we can store values till
4gb limit... right ?? so, any kind of phone number would need integer only..
no need to take long..

And another question is, if the OS is 64 bit then will the integer hold 8
byte value ???

"Arnaud Debaene" <adebaene@xxxxxxxxxxxxxxxx> wrote in message
news:OMLAWDyVFHA.3532@xxxxxxxxxxxxxxxxxxxxxxx
> Jigar Mehta wrote:
> > thanks for the prompt reply carl,
> >
> > So, current windows 2000 32 bit os will be having 32 bit integer..
> > and so, can it hold the value of upto 32 bits.. like 32 ones and
> > zeros combination ??
> Yes, in binary representation.
>
> > I think 32 bit integer is also having the
> > limitation of 32676 or some thing like that limit...
> The limitation for unsigned int in Win32 is 2^32 - 1 = 4294967295 (or 4
> Gigas if you prefer)
>
> The limit you are reffering to is (2^16)/2 -1=32767, which is the max
valeu
> for a signed, 16 bits integral value. With Win32 and current versions of
VC,
> this is the max limit of a signed short.
>
> > So, if it is so, why is it ??
> Why is is what???? What's your problem exactly???
>
> If you want to check the bounds for a given numerical type, in C++ you can
> use std::numeric_limits. For example, std::numeric_limits<int>::max()
give
> you the max value for a signed integer.
>
> Arnaud
> MVP - VC
>
>

.

• Follow-Ups: