Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-25-2003, 10:06 AM   #1
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
formatting output...

How do you format the output so it all lines up perfectly? I am using iomanip and i have setw(15), but it still doesnt line up correctly.

Code:
cout << setw(15) << player[x]->getcash() << endl;
stil gives me this:

Code:
*******************************
Sam           1500
Mary           1000
Pete            500
Sue            500

McDonald Hall      unowned
Commons Eatery      unowned
Darrow Hall      unowned
Bromfield Hall      unowned
Keeper Eatery      unowned
Founders Hall      unowned
Offenhauer Hall      unowned
The Nest Eatery      unowned
Dunbar Hall      unowned
Compton Hall      unowned
Sundial Eatery      unowned
Anderson Hall      unowned
*******************************
Attached Files
File Type: zip lab7a.zip (4.0 KB, 9 views)
GSXdan is offline   Reply With Quote
Old 11-25-2003, 10:20 AM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
I've never used iomanip or setw. I generally just use tabs, like this:

cout << "\t\t\t" << player[x]->getcash() << endl;

where \t is the tab character. It will line up much better.

If you want to use setw, it looks like you will have to set the width to a number that takes into account the length of the person's name.
doctorgonzo is offline   Reply With Quote
Old 11-25-2003, 10:44 AM   #3
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
thanks, that was a lot easier than using iomanip!

thanks again ^dan
GSXdan is offline   Reply With Quote
Old 11-30-2003, 10:18 PM   #4
Member (7 bit)
 
Join Date: Nov 2003
Location: LA
Posts: 101
Send a message via AIM to HNPFL
Wow the game sounds cool what is it about?
HNPFL is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:42 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2