cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Help with C and curl

From: <pppsss7_at_gmail.com>
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 {
       curl_easy_getinfo(curl,CURLINFO_CONTENT_TYPE,&result);
       printf("%c\n", result);
     }
     /* always cleanup */
     curl_easy_cleanup(curl);
   }
   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: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-10-03

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET