delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/05/11:15:15

From: "John Smth" <someone AT microsoft DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: displaying numbers in hexadecimal
Lines: 6
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <CjCn9.3111$bx2.249693279@newssvr12.news.prodigy.com>
NNTP-Posting-Host: 64.216.237.206
X-Complaints-To: abuse AT prodigy DOT net
X-Trace: newssvr12.news.prodigy.com 1033826658 ST000 64.216.237.206 (Sat, 05 Oct 2002 10:04:18 EDT)
NNTP-Posting-Date: Sat, 05 Oct 2002 10:04:18 EDT
Organization: Prodigy Internet http://www.prodigy.com
X-UserInfo1: TSU[@IONSRVWSQDYEJJLN\TDFZ\@@FXLM AT TDOCQDJ@_ AT FNHBK^RAQFW[ML\THRCKV^GGZKJMGV^^_JSCFFUA_QXFGVSCYRPILH]TRVKC^LSN AT DX_HCAFX__@J\DAJBVMY\ZWZCZLPA^MVH_P@\\EOMW\YSXHG__IJQY_ AT M[A[[AXQ_XDSTAR]\PG]NVAQUVM
Date: Sat, 05 Oct 2002 14:04:18 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

How can i get my program to display a number in hexadecimal form? For
example, in my program i have a line cout << 0x9 + 0x2 << "\n";
the output is 11, but i need t to be 'B'. It was suggested to me to add
'<<hex<< to the line but the compiler didnt recognize the 'hex' command.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019