   HEX in Win32
  To display numbers in DOS console in HEX mode I use ios::hex flag.What if I need to display HEX numbers in Win32 or MFC ?For Win32 I display text with TextOut function (and HDC) and for MFC I use CEdit::ReplaceSel Member.   
  It doesn't matter weither it's win32 or with the help of MFC....See if you can grab any ( old) book from Charles Petzold at Ms Press; he has written many win32 programming books.Using MFC you can place a CRichEditCtrl on a CDialog or using a CView display infos with CDC::TextOut   ;  Just use a std::ostringstream to format the number into a string, and then pass that string to your display code:std::string FormatAsHex(int number){std::ostringstream format;format << std::hex;format << number;return format.str();}// Someplace elsepSomeControl->SetWindowText(FormatAsHex(2348).c_str());If you use MFC heavily in your code you can use CString::Format() as well.   ;  Or you could use sprintf...char szBuffer[128];const int iInteger = 15;sprintf(szBuffer, "Base 10: %i\nBase 16: %x", iInteger, iInteger);Of course I'd prefer to use the stringstream way as ApochPiQ mentioned, but this is still an alternative.[Edited by - pizdayob on January 19, 2006 2:00:32 PM]