且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在表中格式化输出,C ++

更新时间:2022-11-30 14:12:22

Can't you do something very similar to the C# example of:

String.Format("|{0,5}|{1,5}|{2,5}|{3,5}|", arg0, arg1, arg2, arg3);

Like:

printf("|%5s|%5s|%5s|%5s|", arg0, arg1, arg2, arg3);

Here's a reference I used to make this: http://www.cplusplus.com/reference/clibrary/cstdio/printf/