pointer to class member function

Jun 30, 2013 at 2:54pm
should I use "&" to point to the function address?If & is omitted, there is compiling error, but I learnt from book no & is needed here. Does it depend on the compiler or there is universe rule for pointer pointing to class member function?

1
2
  int (practice::*funcp)() const=0;
	funcp=&practice::getvar;
Last edited on Jun 30, 2013 at 2:55pm
Jun 30, 2013 at 5:01pm
For non-static member functions you need to use & to get a pointer to the function.
Jun 30, 2013 at 5:13pm
Topic archived. No new replies allowed.