Phlip wrote:
Bilgehan.Balban wrote:
How do I declare an array of function pointers and assign each element
of the array with public member functions of a class?
There's lots of ways. Report back with your actual problem to then learn the
best one.
Google for and check the FAQ for "member pointers".
Is it possible that the array is not a member of the class?
Why not? The pointers are just data; you can put them anywhere if they point
to _public_ member functions.
Actually there is no requirement that the member pointers stored in an
external array point only to public member fuctions. It would be
possible for example to pass an array of member function pointers to an
instance of a class and have it fill the array with pointers to private
methods.
There is a requirement that all the member pointers in the array point
to methods with the same "signature" (number and type of parameters,
return type, const-volatile qualifications) - and that signature is
specified in the array's declaration.
Greg