In C this part of code works fine but in C++ i get an error:
argument of type "void *" is incompatible with parameter of type "FILE *"
How can i fix it? This is the relevant part of code:
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
curl_off_t nread;
size_t retcode = fread(ptr, size, nmemb, stream); /*i get an error on this line on stream */
nread = (curl_off_t)retcode;
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
" bytes from file\n", nread);
return retcode;
}
The solution was simple actually in the end.So if it helps anyone i simply changed void* with FILE *ptr and FILE *stream and it worked