main
if
switch
for
while
do
continue
break
goto
return
sizeof
_Alignof
const
volatile
restrict
struct
union
_Alignas
typedef
_Static_assert
inline
_Noreturn
管理用于填充输入转换到指定宽度的填充字符。
ch
调用函数前的填充字符。
#include <iostream> #include <iomanip> int main () { std::cout << "With default setting : " << std::setw(10) << 40 << '\n'; char prev = std::cout.fill('x'); std::cout << "Replaced '" << prev << "' with '" << std::cout.fill() << "': " << std::setw(10) << 40 << '\n'; }
输出:
With default setting : 40 Replaced ' ' with 'x': xxxxxxxx40