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, 9644👍, 1💬
Popular Posts:
what are the advantages of hosting WCF Services in IIS as compared to self hosting? There are two ma...
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...
How To Calculate Expressions with SQL Statements? - MySQL FAQs - Introduction to SQL Basics There is...
What will be printed as the result of the operation below: main() { int a=0; if (a==0) printf("Cisco...
What are shared (VB.NET)/Static(C#) variables? Static/Shared classes are used when a class provides ...