i was referring some C books and found that int and short int have the same range... then what is the use of two with same range but different names........
Sometimes they don't have the same range. In some embedded applications an int is 32b and a short in is 16b a word is also 16b but isn't treated the same as an int by the compiler.
I believe the only standard ANSI C imposes is that a short can be equal or smaller in size than an int, but never greater. I always get mixed up on compilers for different compilers for different sized micros as towhat the sizes are and end up looking it up in the compiler documentation. I have a PIC compiler where an int is 8 bits, on Windows an int is 32 bits and i beleive a short is 16 bits, but I can't remember..
According to C standard max short size is 2 bytes. Int can be more than that.
Only in machine where int is 2 bytes, both short and ant are same. Other wise they r different.