printing rows and columns

i have some data like names, rounds and marks. i want to display it on the output window like this
pranesh | rahul | utsab
round1| | |
round2| | |
round3| | |

but as the name changes the space required for it to display changes that's why i wanted some solution for that, i expect there must be a better way to do it in c++. can someone help??
Last edited on
There's a setw function in <iomanip> that lets you set a fixed field width for a column. That might help with formatting your data? You could set the field to be wide enough for the largest possible name.

http://www.cplusplus.com/reference/iomanip/
k...thanks..:)
Topic archived. No new replies allowed.