Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How can I implement a variable field width with printf?
How can I implement a variable field width with printf? That is, instead of something like %8d, I want the width to be specified at run time.
✍: Guest
printf("%*d", width, x) will do just what you want. The asterisk in the format specifier indicates that an int value from the argument list will be used for the field width. (Note that in the argument list, the width precedes the value to be printed.)
2021-01-21, 9588👍, 1💬
Popular Posts:
How is normally a project management plan document organized ? PMP document forms the bible of a pro...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
How To Change the Password of Another User Account? - MySQL FAQs - Managing User Accounts and Access...
Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written...
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters? Unicode requires 1...