#include #include #include using namespace std; int main() { // Print table header cout << setw(11) << "Data Type" << setw(7) << "Size" << setw(12) << "Value" << endl; cout << setw(11) << "=========" << setw(7) << "====" << setw(12) << "=====" << endl; /////////////// CHAR ///////////////////// cout << setw(11) << "CHAR_MIN:" << setw(7) << sizeof(char) << setw(12) << CHAR_MIN << endl; cout << setw(11) << "CHAR_MAX:" << setw(7) << sizeof(char) << setw(12) << CHAR_MAX << endl; // Why isn't this available? // cout << "UCHAR_MIN: " << sizeof(UCHAR_MIN) << endl; cout << setw(11) << "UCHAR_MAX:" << setw(7) << sizeof(unsigned char) << setw(12) << UCHAR_MAX << endl; /////////////// SHRT ///////////////////// cout << setw(11) << "SHRT_MIN:" << setw(7) << sizeof(short) << setw(12) << SHRT_MIN << endl; cout << setw(11) << "SHRT_MAX:" << setw(7) << sizeof(short) << setw(12) << SHRT_MAX << endl; // Why isn't this available? // cout << "USHRT_MIN: " << sizeof(USHRT_MIN) << endl; cout << setw(11) << "USHRT_MAX:" << setw(7) << sizeof(unsigned short) << setw(12) << USHRT_MAX << endl; /////////////// INT ///////////////////// cout << setw(11) << "INT_MIN:" << setw(7) << sizeof(int) << setw(12) << INT_MIN << endl; cout << setw(11) << "INT_MAX:" << setw(7) << sizeof(int) << setw(12) << INT_MAX << endl; // Why isn't this available? // cout << "UINT_MIN: " << sizeof(UINT_MIN) << endl; cout << setw(11) << "UINT_MAX:" << setw(7) << sizeof(unsigned int) << setw(12) << UINT_MAX << endl; /////////////// LONG ///////////////////// cout << setw(11) << "LONG_MIN:" << setw(7) << sizeof(long) << setw(12) << LONG_MIN << endl; cout << setw(11) << "LONG_MAX:" << setw(7) << sizeof(long) << setw(12) << LONG_MAX << endl; // Why isn't this available? // cout << "ULONG_MIN: " << sizeof(ULONG_MIN) << endl; cout << setw(11) << "ULONG_MAX:" << setw(7) << sizeof(unsigned long) << setw(12) << ULONG_MAX << endl; /////////////// LONG ///////////////////// cout << setw(11) << "LONG_MIN:" << setw(7) << sizeof(long) << setw(12) << LONG_MIN << endl; cout << setw(11) << "LONG_MAX:" << setw(7) << sizeof(long) << setw(12) << LONG_MAX << endl; // Why isn't this available? // cout << "ULONG_MIN: " << sizeof(ULONG_MIN) << endl; cout << setw(11) << "ULONG_MAX:" << setw(7) << sizeof(unsigned long) << setw(12) << ULONG_MAX << endl; return 0; }