#include <stdio.h>
#include <curl/curl.h>
size_t curl_cb(void *a, size_t b, size_t c, FILE *d)
{ return fwrite(a, b, c, d); }
int main(void)
{
CURL *curl;
CURLcode res;
FILE *dat;
curl = curl_easy_init();
if(curl)
{
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.de/");
dat = fopen("googlede.html", "w");
if(dat)
{
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_cb); //Neu
curl_easy_setopt(curl, CURLOPT_WRITEDATA, dat); //Wieder ohne Kommentarstriche
res = curl_easy_perform(curl);
fclose(dat);
}
else printf("Dateifehler\n");
curl_easy_cleanup(curl);
}
else printf("Initfehler\n");
getchar();
}