Formatting output

I have an array of data i need output. The array is an array of struct.
I have 21 items in the array and need to display them in a formatted table.
The data on each line should resemble:

1
2
Jonathan Toews     2     6     8     +2
Mike Smith         3     6     9     +3


The name is in a char array and the rest are int's. The name must remain a char array. I'm using setw for the numbers but getting the spacing after the name is tough. Each name is a different length and so my output looks like this:

1
2
3
Mike smith     2     6     8     +1
Andrew Smith     3     6     9     +3
Mike Singer     4     7     11     +3


Using setw after the name doesn't work because each name ends at a different point. I looked around but found out that finding the length of a char array is not possible.
You can use right/left justification: http://cplusplus.com/reference/ios/right/
Topic archived. No new replies allowed.