#include<iostream>
#include<stdio.h>
using namespace std;
class Class_my
{
public :
Class_my (int ch):i(ch)
{
}
public :
int foo(int ch)
{
return (i + ch);
}
void show(void)
{
cout << i<< endl;
}
private:
int i;
};
int main ()
{
int temp ;
int (Class_my :: *pmf1)(int ) = &Class_my:: foo;
Class_my c(2);
Class_my *pc = &c;
temp = (pc ->* pmf1)(6);
cout << temp <<endl;
int (Class_my :: *pmf)(int ) = &Class_my:: foo;
int temp1;
Class_my c1(1);
temp1 = (c1 .* pmf)(6);
cout << temp1 <<endl;
return 0;
}
8
7
Press any key to continue