Bug 19183 - formatting iostream output in g++ corrupted
Summary: formatting iostream output in g++ corrupted
Keywords:
Status: CLOSED DUPLICATE of bug 18861
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-16 14:57 UTC by Jerry Lin
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-16 14:58:44 UTC
Embargoed:


Attachments (Terms of Use)
I encountered the bug while working on this program for my computer science class (21.79 KB, text/plain)
2000-10-16 14:58 UTC, Jerry Lin
no flags Details

Description Jerry Lin 2000-10-16 14:57:19 UTC
Using the <b>setf</b> member function for <b>cout</b> to format the
alignment of output does not display correctly on the screen or in an
output file.

For example, using <b>cout.setf(ios::right)</b> to align text output to the
right of the screen with the manipulator <b>setw(15)</b> will print out
garbage characters instead of spaces when dumping all output into a file. 

Interestingly, if you put <b>cout.unsetf(ios::left)</b> right before you
set the flag for right alignment, the garbage characters come before your
output. If you don't manually unset the flag for left alignment, the
garbage characters come after your output.

Comment 1 Jerry Lin 2000-10-16 14:58:42 UTC
Created attachment 4207 [details]
I encountered the bug while working on this program for my computer science class

Comment 2 Jakub Jelinek 2000-10-16 15:21:39 UTC

*** This bug has been marked as a duplicate of 18861 ***


Note You need to log in before you can comment on or make changes to this bug.