title: libcurl HTTP request to save respond into variable - c++
body: <p>I'm trying to save the returned data from HTTP request into a variable.</p>
  
  <p>The code below will automatically print the respond of the request, but I need it to save the respond to a char or string.</p>
  
  <pre><code>int main(void)
  {
          char * result;
          CURL *curl;
          CURLcode res;
          curl = curl_easy_init();
          if(curl) {
              curl_easy_setopt(curl, CURLOPT_URL, "http://www.browsarity.com/");
  
              res = curl_easy_perform(curl);
              curl_easy_cleanup(curl);
          }
          return 0;
   }
  </code></pre>