Do you know sprintf
? It's basically the same thing with fprintf
. The first argument is the destination (the file in the case of fprintf
i.e. stderr
), the second argument is the format string, and the rest are the arguments as usual.
I also recommend this printf
(and family) reference.