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, 9470👍, 1💬
Popular Posts:
When should the method invokeLater() be used? This method is used to ensure that Swing components ar...
How To Add Column Headers to a Table? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells I...
How to set a cookie with the contents of a textbox ? Values stored in cookies may not have semicolon...
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...
What is the value of this expression? +1-2*3/4 -0.5