// ---------------------------------------------------------------------- // // sizeFixedTypes.cc // // Synopsis: Determine implementation-specific size of the basic C++ // types; intended for use in setting up the FixedTypes.h package. // // History: // 05-Feb-1997 WEB Initial draft. // 02-Mar-1998 WEB Renamed (original name: sizer.cc) // 03-Mar-1998 WEB Adjusted the output format // 14-Feb-2000 WEB Removed semicolons after USING() // // ---------------------------------------------------------------------- #include "ZMutility/iostream" USING (std::cout) USING (std::endl) #include "ZMutility/iomanip" USING (std::setw) int main() { #define check(type) cout << setw(2) << sizeof(type) << " " #type "\n" check( char ); check( signed char ); check( unsigned char ); cout << endl; check( int ); check( short int ); check( long int ); cout << endl; check( unsigned int ); check( unsigned short int ); check( unsigned long int ); cout << endl; check( float ); check( double ); check( long double ); cout << endl; return 0; } // main()