We called a library to read text, this library API only accepts a FILE* pointer. It actually reads file text by fread() call internally.
But we also need to use this library to read text from a char* string rather than a FILE*.
Of course we can write the char* string into a temp file but we’re not allowed to do this for some reasons…
How to do ? Thanks !!
Check out fmemopen
The fmemopen() function shall associate the buffer given by the buf argument with a stream.