Search code examples
cgccintembedded-linuxshort

What is the difference between "short int" and "short" in c?


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


Solution

  • 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.