#includeint main() { std::cout.fill('*'); std::cout.width(10); std::cout << "hello"; return 0; }
#includeThis example sets the padding character for the output stream to '-', sets the output width to 5 characters and outputs the number 1234. As there are only 4 digits in 1234, the remaining space is filled with '-'. The std::ostream::fill function is part of the C++ standard library.int main() { std::cout.fill('-'); std::cout.width(5); std::cout << 1234; return 0; }