+ 1
what is the size of int? 2 or 4??
10 Réponses
+ 5
The C++ standard leaves the size of an int open... On 32bit systems it's 32bits = 4 bytes and on a 64bit system it's 64 bits = 8 bytes. Earlier, on 16 bit systems it was 16bit = 2 bytes.
For practical purposes an int can be assumed to be at least 4 bytes on moderately modern PC systems. Also, this depends on the compiler you run, as compilers running on a 32bit system might support creating 64bit code and vice versa.
+ 1
Hi Humphrey,
do you mean if there is a way to determine the actual size of an int on the program you are running? Yes, there is!
You can use the *sizeof* operator. It returns the number of bytes a type or variable has.
Example: sizeof(int)
+ 1
it is depends on which compiler you use
+ 1
size of int depends on compiler.
0
4
0
4 bytes
0
4
0
please I have no... idea whatsoever of C++. need small tutorials
0
yahoooo!!!!!!!!
- 1
Can a value also determine how big or small between 2 to 4 bytes they are?