I\'m looking for a way to pass in a FILE * to some function so that the function can write to it with fprintf. This is easy if I want the output t
FILE *
fprintf
If portability is not important for you, you can take a look on fmemopen and open_memstream. They are GNU extensions, hence only available on glibc systems. Although it looks like they are part of POSIX.1-2008 (fmemopen and open_memstream).