This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
ostringstream::setfill() problem with cvs tree version
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: ostringstream::setfill() problem with cvs tree version
- From: Bruno dot Voigt at ic3s dot de
- Date: Wed, 20 Oct 1999 18:06:56 +0200
Hi !
I am using the latest libstdc++ cvs tree under RH6.0 and
have encountered a problem with the following code:
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
using namespace std;
int main(void) {
string val = "";
ostringstream tmp;
tmp << setw(5) << left << setfill('0') << val;
cout << "result : <" << tmp.str() << ">" << endl;
return 0;
}
It generates the following output: "result: <>"
Under MSVC6 i get the expected result <00000>.
If I change the line string val = "" to int val = 1
setfill()/setw() are working and I get the result <10000>.
Is this a bug or are these manipulators not guranteed to work
with nonnumeric variables?
Any hints are welcome to resolve this problem.
TIA, Bruno
--
Bruno.Voigt@ic3s.de # IC3S AG # Tel. 04106.653815 # Fax. 04106.4618
____________________ # Mobile 0700.686.00.686