chandanlinster wrote:
>
as i was going through the "printf" man page, i came across this
statement.
printf("%*d", width, num);
what does "*" mean?
It's in the standard. From N869:
[#5] As noted above, a field width, or precision, or both,
may be indicated by an asterisk. In this case, an int
argument supplies the field width or precision. The
arguments specifying field width, or precision, or both,
shall appear (in that order) before the argument (if any) to
be converted. A negative field width argument is taken as a
- flag followed by a positive field width. A negative
precision argument is taken as if the precision were
omitted.
--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>