Anyone know how to can make un function pointer in c++ to subclass member
function ?
Example
class Class_1
{
void (*nomFunc) (int);
...
}
class Class_2: public Class_1
{
void foo (int x);
Class_2 ();
}
Class_2::Class_2 ()
{
nomFunc = Class_2.foo;
}
Regards,
--
Where can we use function pointers in C, what are the uses of function
pointers?
come up with new one not like callback , qsort etc...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
one of the use of function pointer is to implement run time polymorphism in
C.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
as function object also
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
Check this
http://andreinc.net/2010/09/30/generic-data-structures-in-c/
On Tue, Sep 6, 2011 at 10:02 PM, Puneet Ginoria punnu.gino...@gmail.comwrote:
i am getting things in C++ but i need all this to be done in C.
--
You received this message because you are subscribed to the Google Groups
i didn't go you..
It will be helpful if you could give me some running example or give me some
link..
Thnx in Advance..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
Hi,
Google Template classes in c++ (or) generic classes in c++ you will get
lots of example
Regards,
S.C.Harish
Associate Software Engineer,
Cordys RD http://www.cordys.com/,
Hyderabad
On Mon, Sep 5, 2011 at 5:11 PM, kARTHIK R k4rth...@gmail.com wrote:
For sending the type, you dont have to
i am getting things in C++ but i need all this to be done in C.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
I have to pass a general array in a function whose type will also be
passed and also a function pointer for or .
e.g.
void function(type , type array, pointer for or )
how will you write it in C?
Thanxx in Advance
--
You received this message because you are subscribed to the Google Groups
For sending the type, you dont have to denote it explicitly. Use templates.
templatetypename T void func (T *a) {
// business logic
}
I dont think you can pass operators directly.
For arithmetic operators, you could use something like this : [refer some
site for exact syntax]
10 matches
Mail list logo