   Pointer to member functions?
  I was wodering if someone could tell me if Dev-C++ or MS VS 2005 support this, because I typed in the source code from a book I have and it says "Invalid use of a npn-static memeber function." Then I copy & pasted the code from the book and it said the same thing.  I am wondering if maybe in a newer standard of c++ they took that function out??  If you need the sourcecode Ill post it when I get home from school.  Thanks for the help.   
  Visual C++ does support it.  The C++ Standard for doing Pointers to Member functions is just very strange.   ;  I don't supposed you have a link to a tut or somthign on it do you? Unfortuneatly the method presented my book Teach Yourself C++ in 21 Days does not work for either.  Thanx   ;  The syntax for a pointer-to-member function is:retval (class_name::*pointer_name)(...)So for a class like:class foo{  public:    int bar(float a,float b);    int baz(float a,float b);}We could form a pointer-to-member like:int (foo::*ptr_to_mem_fun)(float,float);ptr_to_mem_fun = &foo::bar;Note that the address-of operator & is required for pointer-to-member-functions (it is not for regular function pointers). HTH.   ;function-pointer.orgAlso, boost::function is your friend.   ;  You probably did something along these lines:class C{public:  void function();};...void (* C::fptr) ();fptr = &C::function;...fptr();// ORC::fptr();Neither of the above will work, because C++ member functions require an object instance for dispatch, which is not supplied in your pointer-to-member invocation:C c;c.(*fptr)();Ugly as sin, enough to make one rethink the use of pointers to member functions in favor of virtual functions, templated functions and other means of achieving similar genericity/separation.Alternatively, as mentioned above, use Boost. Seriously.   ;Quote:Original post by Oluseyic.(*fptr)();A minor correction: that should be(c.*fptr)();(the .* is a single operator)