Size of int

  • Thread starter Thread starter Agoston Bejo
  • Start date Start date
A

Agoston Bejo

What does exactly the size of the int datatype depends in C++?
Recenlty I've heard that it depends on the machine's type, i.e. on 16-bit
machines it's 16 bit, on 32-bit machines it's 32 etc.
Is this true? Is this true for _all_ C++ compilers?
 
Agoston said:
What does exactly the size of the int datatype depends in C++?
Recenlty I've heard that it depends on the machine's type, i.e. on 16-bit
machines it's 16 bit, on 32-bit machines it's 32 etc.
Is this true? Is this true for _all_ C++ compilers?

According to the C++ standard, int is at least 16 bits. So in some
systems it may be 16 bit, in others 32, and in others 64 etc.

In .NET it is 32.
 
Back
Top