We help IT Professionals succeed at work.

Function Pointer in a class

sunild
sunild asked
on
Medium Priority
232 Views
Last Modified: 2011-09-20
i have a class
class myclass
{
int (*fptr)();
public:
int f1(){}
int f2(){}
};
i want the function pointer to point a member function of the class
like i would like to get
class myclass a[]={f1,f2,};
How can I do it.
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
hear hear!

Author

Commented:
i had only 1 pt left.
Now bec's of u adding ans it's increased by 5

Commented:
sunild, first you have one answer.  Evaluate it, post your comments and we'll continue from there.
Second, the accepted point scale is: easy=50, medium=100, hard=200.  Single digit offerings will cause many experts to ignore your questions.  Points can be purchased.

Commented:
Offering 1 point (or 6 points) marks you as a scrooge.
Letting the question autograde marks you as lazy, inconsiderate and rude.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.