#include /* for printf definition */ #include /* EXIT_SUCCESS */ #include /* well, duh */ #include /* for CHAR_MIN, CHAR_MAX, etc. */ #include /* for FLT_DIG, DBL_DIG, etc. */ int main (int argc, char *argv[]) { printf("char\t\t%d bytes %d to %d\n", sizeof(char), CHAR_MIN, CHAR_MAX); printf("unsigned char\t%d bytes %d to %d\n", sizeof(unsigned char), 0, UCHAR_MAX); printf("short\t\t%d bytes %hd to %hd\n", sizeof(short), SHRT_MIN, SHRT_MAX); printf("unsigned short\t%d bytes %hu to %hu\n", sizeof(unsigned short), 0, USHRT_MAX); printf("int\t\t%d bytes %d to %d\n", sizeof(int), INT_MIN, INT_MAX); printf("unsigned int\t%d bytes %u to %u\n", sizeof(unsigned int), 0, UINT_MAX); printf("long\t\t%d bytes %ld to %ld\n", sizeof(long), LONG_MIN, LONG_MAX); printf("unsigned long\t%d bytes %i to %lu\n", sizeof(unsigned long), 0, ULONG_MAX); printf("float\t\t%d bytes %e to %e\n", sizeof(float), FLT_MIN, FLT_MAX); printf("double\t\t%d bytes %e to %e\n", sizeof(double), DBL_MIN, DBL_MAX ); printf("precision of float\t%d digits\n", FLT_DIG); printf("precision of double\t%d digits\n", DBL_DIG); printf("\n"); printf("char*\t%d bytes\n", sizeof(char*)); printf("int*\t%d bytes\n", sizeof(int*)); return EXIT_SUCCESS; }