Pointer syntax

From vegard.wiki
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...)