Pointer syntax

From vegard.wiki
Revision as of 08:31, 29 January 2020 by Vegard (talk | contribs) (function pointer)
Jump to navigation Jump to search

C/C++

Pointer to function

Declaration:

return_type (*name)(args...))

Pointer to member

Declaration:

member_type type::*member

Dereference:

type obj;
obj.*member
type *obj;
obj->*member

Pointer to member function

Declaration:

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

Dereference:

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