Я понял!
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
char buf[size*nmemb+1];
char * pbuf = &buf[0];
memset(buf, '\0', size*nmemb+1);
size_t i = 0;
for(; i < nmemb ; i++){
strncpy(pbuf,ptr,size);
pbuf += size;
ptr += size;
}
printf("%s",buf);
return size * nmemb;
}
int main(int argc, char **argv)
{
CURL *curl_handle;
curl_handle = curl_easy_init();
enum{Command,URL,NumCommands};
if(NumCommands != argc){
fprintf(stderr,"Usage : %s <url>\n",argv[0]);
return 1;
}
curl_easy_setopt(curl_handle, CURLOPT_URL, argv[URL]);
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS ,1);
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION,&write_data);
curl_easy_perform(curl_handle);
curl_easy_cleanup(curl_handle);
return 0;
}
Спасибо, Шестигранник.