EDIT:
But then again, there's no point in doing all these things to access a PRIVATE member function of a class (except, perhaps in extreme conditions). Either use friends or make the PRIVATE member function public
public:
int calc_area(double b, double h)
//a method that doesn't modify or use the state of the object in any way
//¿why is it a method then?
{
cout << "Class method";
return b * h;
}
//...
MyClass* object = new MyClass;
METHOD Action = &MyClass::calc_area;
(object->*Action) (4.4, 3.3); //extra indirection
delete object; //new and delete in the same scope
cin.ignore(); //unnecessary
Please cut your left hand.
Edit:
1 2
MyClass object;
object.calc_area(4.4, 3.3);
However that doesn't respond the OP request.
A private method/member can't be accessed outside (that's why it is private). It is used as a helper, called by other methods (maybe the constructor in OP case).
Thanks for the help, everyone! I figured it out. I didn't want to do it. Frankly, I want to be sleeping, but my professor seems to think it is necessary to my C++ career.
Oh well. Thanks again!