c++ on VS19 - how can I display a table of number with cloumns aligned using cout

Keith Lovell 61 Reputation points
2020-09-03T13:03:39.443+00:00

I want to display a scoreboard on the console with the columns lining up as shown in the example below.

Team 1 (2) 5 30 45 62
Long name team (0) 10 28 49 165

The team names are type string (at the moment) and the numbers are integers.

I am using the latest versions of c++ and Visual Studio.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,753 questions
{count} votes

Accepted answer
  1. RLWA32 45,691 Reputation points
    2020-09-03T14:34:50.193+00:00

    Here's something to get you started using-insertion-operators-and-controlling-format


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.