首页 > 编程语言 > 详细

关于 setw() 函数(C++)

时间:2019-12-25 01:55:38      阅读:138      评论:0      收藏:0      [点我收藏+]
// about setw()
#include <iostream>
#include <iomanip>
#include <cstring>


using namespace std;

int main()
{
    string name = "wangyang"; // generate a string
    cout << setiosflags(ios::right) << setfill(a) << setw(20) << name << endl; // control the word count, the alignment, the fill

    return 0;
}

技术分享图片

关于 setw() 函数(C++)

原文:https://www.cnblogs.com/zijidefengge/p/12094337.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!