Vector printed in columns

I have a vector filled with 52 elements and I want to print them into 3 columns. How would I do that? I mean, I can print them with some loops and have spaces in between but I thought there had to be a better way... Any suggestions would be greatly appreciated!
No loops is how it should be done. I suppose you could also define your own stream class and a new set of manipulators, but that is kind of complicated for something easily done with loops.
If what your asking is if the vector has a preprogrammed function?
Then, no.

You have to use loops and do it the hard way.
It's actually not really that hard. Loop through and just use setw with the appropriate size before each output.

http://cplusplus.com/reference/iostream/manipulators/setw/
Topic archived. No new replies allowed.