Basic of programming

int 32 bit ???

hello @Ds_aizen
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.

Other factor on which the size of data type depends is the compiler on which you are perform any program i.e. In turbo c/c++ the size of int is 2 bytes but in compiler like codeblocks,dev c/c++ etc is 4 bytes.

The size of various data types are:-

Type Storage size

char 1 byte

unsigned char 1 byte

signed char 1 byte

int 2 or 4 bytes

unsigned int 2 or 4 bytes

short 2 bytes

unsigned short 2 bytes

long 4 byte

unsigned long 4 bytes.