Size of int is 2 or 4

C programming

2/9/2020 4:04:16 AM


4 Answers

New Answer


It depends. Run this code to be sure: printf("%d",(int)sizeof(int));


ARAVINDH ARAVINDH size of int is compiler dependent or more appropriately processor dependent. If you are using a 16bit machine than it is 2 Bytes If you are using a 32 or 64 bit machine than it is 4 bytes. Best way is to use sizeof(int) to find the actual size on your system


It depends kn complier. You can check it by using sizeof(int).