I have this code:
#include <iostream>
class foo
{
public:
foo(int yy){y = yy;}
void f(int x){std::cout<<x;}
private:
int y;
};
void main()
{
foo* obj = new foo(123);
void (foo::*func)(int) = &foo::f;
//how do I call func with obj as this?
delete obj;
}
Is this possible?