title: convert CURLcode res to a char*
body: <p>I want to receive the contents of a webpage to work with.
  So i need the contents to be stored in a variable <code>char*</code>/<code>string</code></p>
  
  <p>Since you can display the contents with <code>printf</code> i was trying to use <code>sprintf</code> to see if i can store the contents but it's not working at all</p>
  
  <pre class="lang-c prettyprint-override"><code>int main () {
      CURL *curl = curl_easy_init();
      char rstr[80];
  
      if(curl) {
          CURLcode res;
          curl_easy_setopt(curl, CURLOPT_URL, "https://api.binance.com/api/v3/png");
          res  = curl_easy_perform(curl);
          curl_easy_cleanup(curl);
          printf("%u\n",res);
          sprintf(rstr,"%u\n",res);
      }
  
      printf("%s\n",rstr);
      return 0;
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;&lt;body&gt;&lt;h2&gt;404 Not found&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;0
  0
  </code></pre>
  
  <p>While expecting:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;&lt;body&gt;&lt;h2&gt;404 Not found&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;0
  &lt;html&gt;&lt;body&gt;&lt;h2&gt;404 Not found&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;0
  </code></pre>
  
  <p>This means the <code>printf("%u\n",res);</code> shows the contents and an additional 0.<br>but <code>sprintf(rstr,"%u\n",res);</code> just contains 0 without the site contents.</p>
  
  <p>How can i convert/store the contents  to a <code>char[]</code>, <code>char*</code> or <code>string</code>?</p>