cURL / Mailing Lists / curl-library / Single Mail


Help with C and curl

From: <>
Date: Sat, 3 Oct 2009 20:56:40 +0400

Im trying to use libcurl in my C code.
I have low level experience in C, but I try to use it and practice it
with curl lib and without. Ok its lyrics.

I have simple code with libcurl:

#include <curl/curl.h>

int main(void)
   CURL *curl;
   CURLcode res;
   char errbuf[CURL_ERROR_SIZE],result;

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, 'server');
     curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
     curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
     res = curl_easy_perform(curl);
     if(res != 0){
       printf("%s\n", errbuf);
     } else {
       printf("%c\n", result);
     /* always cleanup */
   return 0;

       printf("%c\n", result); the string return abra-kadabra
What's wrong ? I try tu use %s and nothing true again.

List admin:
Received on 2009-10-03