#include struct Foo { int a; int b; int c; double d; double e; int calc() { return static_cast(d);} }; int main() { Foo bar; // declare a double pointer to member of class Foo // initialize the variable to Foo's d double Foo::* p_member = &Foo::d; // declare a pointer to member function of class Foo that returns int and takes no arguments // initialize the variable to Foo's calc function int (Foo::* p_member_func)() = &Foo::calc; // assign a value to bar's member, pointed to by p_member bar.*p_member = 3.14; // call a member function on bar, member function is in the pointer to member function variable p_member_func std::cout << (bar.*p_member_func)() << std::endl; return 0; }