+ 3
size of datatypes
Does the size of int data type depends on system/compiler
1 Answer
+ 7
The size of data types is dependent on the compiler or you can say that the system architecture i.e. 32 bit compiler or 64 bit compiler.
The size of data type int is 2 byte in 32 bit architecture or 4 bytes in 64 bit architecture.
By the above example, you can understand that the size of various data is architecture dependent. i.e. 32 bit or 64 bit.
Another factor on which the size of data type depends is the compiler on which you perform any program i.e. In turbo c/c++ the size of int is 2 bytes but in the compiler like codeblocks, dev c/c++ etc is 4 bytes.
https://stackoverflow.com/questions/2331751/does-the-size-of-an-int-depend-on-the-compiler-and-or-processor