cURL / Mailing Lists / curl-library / Single Mail

curl-library

callback function in C++

From: Jacek Jablonski <yacek87_at_gmail.com>
Date: Sat, 21 Jan 2006 18:27:02 +0000

Hello!
Can someone write me a simple function in C++ so that I could pass it into
curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, write_data);
The function have to write the remote file into chunk of memory as a string.
Someone gave me this link
http://curl.haxx.se/lxr/source/docs/examples/getinmemory.c. Unfortunatelly
it is useless for me, because I completly don't understand C (those mallocs,
allocs), so please use new and delete. This function could be very usefull.
I even don't know what arguments in this function mean: size_t
write_data(void *buffer, size_t size, size_t nmemb, void *userp);
So if anyone would be nice, please write such a function.

Greetings,
Jacek Jablonski
Received on 2006-01-21