Solved

Function Pointer in a class

Posted on 1998-11-28
5
185 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.
0
Comment
Question by:sunild
  • 3
5 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 0 total points
ID: 1178776
int (*myclass::fptr)();

Offering 1 point marks you as a scrooge.
0
 
LVL 1

Expert Comment

by:Booth882
ID: 1178777
hear hear!
0
 

Author Comment

by:sunild
ID: 1178778
i had only 1 pt left.
Now bec's of u adding ans it's increased by 5
0
 
LVL 11

Expert Comment

by:alexo
ID: 1178779
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
 
LVL 11

Expert Comment

by:alexo
ID: 1178780
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now