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, 1199👍, 1💬
Popular Posts:
What are the core functionalities in XML .NET framework? Can you explain in detail those functionali...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...
How do you handle change request? Normally change request are handled by preparing an Impact analysi...
Can we use the constructor, instead of init(), to initialize servlet? Yes , of course you can use th...
Have you ever worked with Microsoft Application Blocks, if yes then which? Application Blocks are C#...