[algogeeks] Function pointer in c++ to subclass member function

2013-03-18 Thread Luciano Junior
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, --

Re: [algogeeks] FUNCTION POINTER IN C

2011-09-07 Thread HARISH S.C
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

Re: [algogeeks] FUNCTION POINTER IN C

2011-09-06 Thread Puneet Ginoria
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

Re: [algogeeks] FUNCTION POINTER IN C

2011-09-06 Thread HARISH S.C
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

Re: [algogeeks] FUNCTION POINTER IN C

2011-09-06 Thread Puneet Ginoria
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

[algogeeks] FUNCTION POINTER IN C

2011-09-05 Thread punnu
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

Re: [algogeeks] FUNCTION POINTER IN C

2011-09-05 Thread kARTHIK R
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]