I have a solution with many projects.
I would like to make a class inside common project that receive array and pointer to function.
This class is a member in other projects on that solution. each project class can hold it as member.
On the constructor of the class inside common, How do i pass the pointer of the function ? how do i set a member inside the common class that holds the location of the function i would like to invoke later on ?
My goal is that i can invoke the function using the pointer – while im in the code of the class that is found in the common project..
Thanks
This defines my function pointer type, but it also restricts the function to the signature below (retuens void and takes 1 int param) you need to define this for your function signature.
In C++ you might well be better however thinking about using function objects in which you create an object and define an
operator()which takes the correct parameters and return type but would allow you all the flexibility of objects and polymorphism….See C++ Functors – and their uses for some discussion and detail