|
#include <stdio.h> int main( int argc, char* argv[] ) { printf("sizeof(char) = %lu\n", sizeof(char) ); // 1 printf("sizeof(short) = %lu\n", sizeof(short) ); // 2 printf("sizeof(int) = %lu\n", sizeof(int) ); // 4 printf("sizeof(long) = %lu\n", sizeof(long) ); // 8 printf("\n"); printf("sizeof(float) = %lu\n", sizeof(float) ); // 4 printf("sizeof(double) = %lu\n", sizeof(double) ); // 8 printf("\n"); int x; double y; printf("sizeof(x) = %lu\n", sizeof(x) ); // 4 printf("sizeof(x) = %lu\n", sizeof(y) ); // 8 } |
|