One quick way to do it would be to convert the col # into a character, by taking advantage of ASCII values. std::cout << std::setw(3) << STARTING_VAL + row << static_cast<char>(col + 'A') << ' ';
An alternative way to do it would be to declare a string outside the loop. constchar* col_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
And then do std::cout << std::setw(3) << STARTING_VAL + row << col_letters[col] << ' ';
in the loop.
Obviously you'll start to need extra logic if you go beyond 26 columns.