Please post the smallest possible complete program that illustrates your problem. But your setw() of 5 seems a little small, especially for your names. But you have a number with 5 characters "82.80" so when your "string" is equal to or larger than your setw() will not seem to be used. Remember setw() doesn't add characters to your "string" unless it is larger than the "string".