4 ms·
The trick is in the 'n' conversion specifier: http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html http://pubs.opengroup.org/onlinepubs/009695
by userbinator 9y ago
The trick is in the 'n' conversion specifier:
http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html http://pubs.opengroup.org/onlinepubs/009695399/functions/fpr...
"The argument shall be a pointer to an integer into which is written the number of bytes written to the output so far by this call to one of the fprintf() functions. No argument is converted."
The * parameter provides the "input", since it allows controlling the number of bytes written with its parameter, which is then written to the n parameter.