mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
FAQ: Fix typos in section 5.14 (#1047)
Type required for YourClass::func C++ function (using size_t in line with the documentation for CURLOPT_WRITEFUNCTION) and missing second colon when specifying the static function for CURLOPT_WRITEFUNCTION.
This commit is contained in:
parent
9eda44a200
commit
2a1d538963
4
docs/FAQ
4
docs/FAQ
@ -1385,14 +1385,14 @@ FAQ
|
||||
member function that is passed a pointer to the class:
|
||||
|
||||
// f is the pointer to your object.
|
||||
static YourClass::func(void *buffer, size_t sz, size_t n, void *f)
|
||||
static size_t YourClass::func(void *buffer, size_t sz, size_t n, void *f)
|
||||
{
|
||||
// Call non-static member function.
|
||||
static_cast<YourClass*>(f)->nonStaticFunction();
|
||||
}
|
||||
|
||||
// This is how you pass pointer to the static function:
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass:func);
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass::func);
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);
|
||||
|
||||
5.15 How do I get an FTP directory listing?
|
||||
|
Loading…
Reference in New Issue
Block a user