www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/22/06:16:35

From: Ian Chapman <ichapman AT nortel DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: PEST or BUG
Date: Wed, 19 Nov 1997 07:29:41 -0500
Organization: Nortel
Message-ID: <3472DBB5.71A7@nortel.ca>
Reply-To: ichapman AT nortel DOT ca
NNTP-Posting-Host: bcarib90.bnr.ca
Mime-Version: 1.0
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

//      To test the cout under conditions of varying format.
#include <iostream.h>
int main()
{
int Ia, Ib;
float Fc;
Ia = 0x1a;
Ib = 0x1b;
Fc = 123.56789;
cout << "Ia in dec is ..." << Ia << endl; // prints in decimal
cout << "Ib in dec is ..." << Ib << endl; // prints in decimal
cout << "Ia in hex is ..." << hex << Ia << endl; // prints in HEX
cout << "Ib in dec is ..." << Ib << endl; // still prints in HEX
cout << "Ia in dec is ..." << Ia << endl;
cout << "Ib in dec is ..." << Ib << endl;
cout << "Fc is float  ..." << Fc << endl; // Okay
cout << "Ia in dec is ..." << Ia << endl; // still prints in HEX
cout << "Ib in dec is ..." << Ib << endl;
}
Hi all,
     this is a pest and I can live with it.  My preference is to have
cout in dec at every call and only stream through hex when explicitly
called.  As some one who is involved in applications close to the
hardware I need hex.  I must wonder what this will do to many of the
libs and class libs.

        Regards Ian.

- Raw text -


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