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

What is the difference between declaring variables as short int and short? In the gcc compiler, short takes 2 bytes (checked with sizeof (short)), and short int also gives 2 bytes size. Are both the same - different? In this case, these ads will be useful?

Thanks in advance

+5
source share
2 answers

short not suitable for short int , they are equivalent in any C compiler.

The same goes for long int vs long , long long int vs long long .

+6
source

short , short int , signed short int and signed short are all the same data types.

So sizeof(short) == sizeof(short int)

The same goes for long

+2
source

Source: https://habr.com/ru/post/1212611/


All Articles