I think the const in this case would cause the pointer to be fixed. The
data referred to by the pointer can still be updated.
This is a similar question on stackoverflow:
http://stackoverflow.com/questions/6407041/constant-pointer
On Tue, Jul 30, 2013 at 7:06 PM, Marios Hadjieleftheriou
<mhadji@gmail.com>wrote:
> The string_completiion_t callback signature of the Zookeeper C API is:
>
> typedef void(* string_completion_t)(int rc, const char *value, const void
> *data)
>
> That means that when the callback is called, the user provided data is
> returned as a const void and cannot be modified by client code, which
> kind of defeats the purpose of passing any data in the first place.
>
> Is there any reason why this parameter needs to be const?
>
--
Mohammad Shamma
|