what is the difference between declaring the variables as short int and short? In gcc compiler the short occupies 2 bytes(checked with sizeof(short)),and short int is also giving the 2bytes of size.Is both are same are different?In which case these declarations will helpful?
Thanks In Advance
short
is short for short int
, they are equivalent in any C compiler.
The same for long int
vs long
, long long int
vs long long
.
short
, short int
, signed short int
, and signed short
are all same data-types.
So sizeof(short) == sizeof(short int)
The same goes for long
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With