#include /* Show how much memory is used by primitive types. * * N.B.: sizeof() is an operator, not a function! * * N.B.: the standard requires that * sizeof(short X) <= sizeof(X) <= sizeof(long X), * e.g. "int" and "long int" may have the same * memory requirements. */ int main() { printf("Size of (in bytes):\n"); printf("int: %d\n", sizeof(int)); printf("short int: %d\n", sizeof(short int)); printf("long int: %d\n", sizeof(long int)); printf("char: %d\n", sizeof(char)); printf("float: %d\n", sizeof(float)); printf("double: %d\n", sizeof(double)); printf("long double: %d\n", sizeof(long double)); return 0; }