[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cout-bug?
From: |
Alexander . Kuchler |
Subject: |
cout-bug? |
Date: |
Fri, 26 Jan 2001 14:18:45 +0100 |
I'm using gcc 2.95.2 and
I got the following problem:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main(){
string x="Hello";
cout.setf(ios::right);
cout << setw(20) << x;
cout << endl;
cout.setf(ios::right);
cout << setw(20) << "Hello";
return(0);
}
the output is:
Hello
Hello
I this a bug or a feature?!
Why there are not the same results?
I tried out a few combinations with \0-termination, too. Without any
effects!
I would be grateful for any tip, what I do wrong or any bugfix!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- cout-bug?,
Alexander . Kuchler <=