I was going through a libcurl
example and saw CURL *&conn
being passed as one of the arguments. What does this construct mean?
Here's the code where it occurs:
// // libcurl connection initialization //
static bool init(CURL *&conn, char *url)
{
CURLcode code; conn = curl_easy_init();
if (conn == NULL)
{
fprintf(stderr, "Failed to create CURL connection\n");
exit(EXIT_FAILURE);
}
code = curl_easy_setopt(conn, CURLOPT_ERRORBUFFER, errorBuffer);
if (code != CURLE_OK)
{
fprintf(stderr, "Failed to set error buffer [%d]\n", code);
return false;
}
return true;
}
Edit: I asked this when I was a beginner and didn't realise duplicates existed. Thanks Stack Overflow.