I am studying C++ and I am focusing on cout
manipulator functions.
By running the following code I get an indentation in the second line containing Gauthier
.
#include <iostream>
#include <iomanip>
int main()
{
std::cout << std::setw(10) << std::setiosflags(std::ios::left)
<< "Mathieu\n"
<< "Gauthier\n"
<< "Paul\n"
<< "Louis\n"
<< "Pierre\n"
<< std::endl;
return 0;
}
Can someone explain to me what is happening?
Why Gauthier
is indented while the other names are not?
Mathieu
Gauthier
Paul
Louis
Pierre
Program ended with exit code: 0