DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
iostream examples

char insertion operator

The stream library did not contain an insertion operator for char. So inserting a char was taken as inserting an integer value, and it was converted to decimal. This omission was due to problems with overload resolution in early versions of the AT&T C++ Language System. Any old code such as:

   char c ;
   cout << c ;
may be replaced by:
   char c ;
   cout << (int)c ;

Previous topic: Assignment

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004