I am trying to have a FILE*
in C that can write to a string buffer in memory rather than a file on disk.
I know that this functionality exists in the fmemopen function, but I am not running my program on Linux so this is not a solution for me. I have seen implementations for Mac as well, but I am programming for a Cortex M4 ARM processor, so I can't use this as well.
Any solutions out there that would potentially work when programming for a Cortex M4?
EDIT: To clarify, I need to end up with a FILE
structure because I need to pass a FILE*
into a library function I am using (libjpeg's jpeg_stdio_dest()
and jpeg_stdio_src()
functions) which specifically takes in a FILE*
as an argument.