Hi,
Check the below code
int add(int a, int b)
{
return a + b;
}
void functionptrdemo()
{
typedef int *(funcPtr) (int,int);
funcPtr ptr;
ptr = add; //IS THIS CORRECT?
int p = (*ptr)(2,3);
cout<<"Addition value is "<<p<<endl;
}
In the place where I try to assign a function to function ptr with same function signature, it shows a compilation error as error C2659: '=' : function as left operand