|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
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; 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 ******************************* |
|
|
|
|
|
#2 |
|
Professional gadfly
|
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. |
|
|
|
|
|
#3 |
|
Member (10 bit)
|
thanks, that was a lot easier than using iomanip!
thanks again ^dan |
|
|
|
|
|
#4 |
|
Member (7 bit)
|
Wow the game sounds cool what is it about?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|