[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Function Pointer in a class

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.
0
sunild
Asked:
sunild
  • 3
1 Solution
 
alexoCommented:
int (*myclass::fptr)();

Offering 1 point marks you as a scrooge.
0
 
Booth882Commented:
hear hear!
0
 
sunildAuthor Commented:
i had only 1 pt left.
Now bec's of u adding ans it's increased by 5
0
 
alexoCommented:
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.
0
 
alexoCommented:
Offering 1 point (or 6 points) marks you as a scrooge.
Letting the question autograde marks you as lazy, inconsiderate and rude.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now