Saturday, 14 September 2013

Short Data Type in Programming

Short Data type

We noted that the integer occupies four bytes in memory. So if we have to store a small integer like 5, 10 or 20 four bytes would be used. The C Language provides another data type for storing small whole numbers which is called short. The size of short is two bytes and it can store numbers in range of -32768 to 32767. So if we are going to use variable for which we know that it will not increase from 32767, for example the age of different people, then we use the data type short for age. 

No comments:

Post a Comment