c
C
C
Variable column widths, string lengths in printf-style functions
I have been programming in C for quite some time, but until recently I was not aware that you could specify column widths and string limits using variables. I have neither seen this functionality used in any projects until I started working with OpenSER.
Specify a variable column width:
printf("%*d", width, number);
Specify a variable number of characters from a string:
printf("%.*s", width, string);
Recent comments
1 week 2 days ago
1 week 2 days ago
1 week 3 days ago
1 week 5 days ago
1 week 5 days ago
2 weeks 2 days ago
3 weeks 2 days ago
3 weeks 3 days ago
3 weeks 4 days ago
4 weeks 1 day ago