I'm using cURL in C and want to have the page header and body written to memory rather than a file:
static size_t writeData(void *ptr, size_t size, size_t nmemb, void *stream)
{
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
}
This thread details doing it in C++, and this thread details doing it in GCC.
From what I can find (here and here), there is no way of doing it in MVSC - or not easily.
Surely there must be some way of doing this, if not by substituting the file stream then with some function of the cURL library? Maybe some way of getting around the pointer to a stream that is passed? I'm stumped!