In a project I must show the following on the screen:
La Jornada con mas puntos es la 5 con 344 puntos.
> Jornada 5
-----------------------------------------
R._Madrid 84 - 91 Barcelona
Manresa 84 - 85 Joventut
The problem is that I have something like this:
R._Madrid 84 - 91 Barcelona
Manresa 84 - 85 Joventut
What could I do to make it line up based on the script? I've thought about counting the number of characters in the name, but since it's a non-string data type, I think it won't work.
Thank you
You can do it manually, that is, calculate the size of each text and add spaces as needed, or you can use the standard library utilities
option 1: library
iomanip
Departure:
option 2: modifiers
cout
Each field could be formatted to also play with the right and left alignments, but the reading and understanding of the example is complicated
You can use
cout
but you should know that cout has some methods that help you to format the output.WIDTH
You can review more of this in reference width