C Programming Reference >> C Basic Tutorials >> C Keywords Home >> shortui 30/12/06 - Views - Ratings : This is a type modifier and is used to modify int. As you know int can be of 2 or 4 bytes depending upon the machine. To make the code portable you cannot assume a size to vary from machine to machine. Short int is always of 2 bytes. Code - void function (void)
{
short int a = 10;
short int b;
b = scanf ("%d", &b);
printf ("%d %d",a, b);
}
|