cURL / Mailing Lists / curl-library / Single Mail

curl-library

Storing curl_easy_perform in variable

From: Sheldon Neuberger <neuberger_at_gmail.com>
Date: Sun, 04 Jun 2006 20:10:04 -0400

Hello,

I am new to libcurl and I am trying to retrieve an IP address from
whatismyip.org. I want to then store that IP address in a string. I have
the following chunk of code

        CURL *curl;
        CURLcode res;

        curl = curl_easy_init();
        if(curl) {
                curl_easy_setopt(curl, CURLOPT_URL, "whatismyip.org");
                res = curl_easy_perform(curl);
        

        curl_easy_cleanup(curl);
        }
        return 0;

However, I do now know how to store the stuff retrieved from the page into
a variable. Thanks in advance for any help.
Received on 2006-06-05