Sizeof example
#include <stdio.h>
main()
{
printf("size of char is %d\n",
sizeof(char));
printf("size of int is %d\n",
sizeof(int));
printf("size of float is %d\n",
sizeof(float));
printf("size of double is %d\n",
sizeof(double));
}
You get the following print out:
size of char is 1
size of int is 4
size of float is 4
size of double is 8
This is program
pg138.c
Previous slide
Next slide
Back to first slide
View graphic version