20 December 2010

C - %n format specifier in printf

Well, what does the format specifier %n of printf function do?

Explanation:
Print nothing, but write number of characters successfully written so far into an integer pointer parameter.

Example:

Output:
blah blah
val = 38

Cheers!
Jack

No comments: