// numstring.h // // Interface and implementation for number to string converion class #ifndef _NUMSTRING_H_ #define _NUMSTRING_H_ #include class CNumString : public CString { public: CNumString(int num, int base = 10) { char *b = GetBuffer(33); // allow room for 32 binary digits _itoa(num, b, base); ReleaseBuffer(); } CNumString(long num, int base = 10) { char *b = GetBuffer(33); // allow room for 32 binary digits _ltoa(num, b, base); ReleaseBuffer(); } // full implementation would include floating point conversions as well }; #endif // _NUMSTRING_H_