home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
099
/
IOSTREAM.ZIP
/
EX_O32.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-07
|
377b
|
21 lines
// EXAMPLE OUTPUT-32
// HOW TO PRINT A CHARACTER AS A
// DECIMAL, OCTAL AND HEXADECIMAL
// VALUE.
#include <header.h>
int main()
{
char ch = 'A' ;
cout << (int)ch << '\n' ;
cout.setf(ios::oct , ios::basefield) ;
cout << (int)ch << '\n' ;
cout.setf(ios::hex , ios::basefield) ;
cout << (int)ch << '\n' ;
return 0 ;
}