I know how to set field width but only applying to the first element in the stream. For example.
cout << setw(5) << left << '1' << '2';
produces
1 2
and
cout << setw(5) << left << '1' << '2' << '3';
produces
1 23
How can I use the iomanip library to set the field width so that it applies to all elements producing
1 2 3
instead of writing setw(5) twice like below:
cout << setw(5) << left << '1' << setw(5) << left << '2' << '3';