Pointer syntax

From vegard.wiki
Revision as of 10:31, 10 February 2020 by Vegard (talk | contribs) (clarify names)
Jump to navigation Jump to search

C/C++

Pointer to function

Declaration:

return_type (*function_name)(args...)

Pointer to member

Declaration:

member_type type::*member_name

Dereference:

type obj;
obj.*member_name
type *obj;
obj->*member_name

Pointer to member function

Declaration:

return_type (type::*member_name)(args...)

Dereference:

type obj;
(obj.*member_name)(args...)
type *obj;
(obj->*member_name)(args...)