Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
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, 3567👍, 1💬
Popular Posts:
What is Traceability Matrix? Traceability Matrix is one of the document will prepare by QA.To make s...
How does multi-threading take place on a computer with a single CPU? The operating system's task sch...
what is a service contract, operation contract and Data Contract? - part 1 In the below sample we ha...
Can Multiple Cursors Being Opened at the Same Time? - Oracle DBA FAQ - Working with Cursors in PL/SQ...
What are the two kinds of comments in JSP and what's the difference between them? <%-- JSP Co...