Use output handlers such as, for example, std::setw
, std::left
, std::right
and others.
To use them, turn on the <iomanip>
header
Here, for example, how to display the title
#include <iostream> #include <iomanip> int main() { std::cout << "ID# " << std::setw( 22 ) << std::left << "ATTRIBUTE_NAME" << std::setw( 8 ) << "FLAG" << std::setw( 6 ) << "VALUE" << std::setw( 6 ) << "WORST" << std::setw( 7 ) << "THRESH" << std::setw( 9 ) << "TYPE" << std::setw( 8 ) << "UPDATE" << std::setw( 12 ) << "WHEN_FAILED" << "RAW_VALUE" << std::endl; }
As a result of the launch, you will get an output
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATE WHEN_FAILED RAW_VALUE