sizeof

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include <stdio.h>
int main()
{
printf("Size of type \"short\"-%d bytes\n", sizeof(short));
printf("Size of type \"int\"-%d bytes\n", sizeof(int));
printf("Size of type \"long\"-%d bytes\n\n", sizeof(long));
printf("Size of type \"float\"-%d bytes\n", sizeof(float));
printf("Size of type \"double\"-%d bytes\n\n", sizeof(double));
printf("Size of type \"char\"-%d bytes\n\n", sizeof(char));
return 0;
}