Pointer syntax

From vegard.wiki
Revision as of 13:50, 18 April 2020 by Vegard (talk | contribs) (add category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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...)