/* --------------------------------------------------------------------------- // Figure 4.4: The size of things. // Demonstrate the use of sizeof to determine memory usage of data types. */ #include #define e 2.718281828459045235360287471353 /* The mathematical constant e. */ void main( void ) /* how to use sizeof */ { int s_int, s_double, s_unknown, k; s_double = sizeof (double); /* use parentheses with a type name */ s_int = sizeof k ; /* no parentheses needed with a variable */ printf( " sizeof int = %i \n sizeof double = %i \n", s_int, s_double ); s_unknown = sizeof e ; printf( " sizeof e = %i \n", s_unknown ); }