jeudi 30 juin 2022

How can I pass member function with parameters to a function that resides in other files?

Just giving an example here to understand what I actually need to do.

#include "otherfile.hpp"
class Example{
   void exampleFun(int arg);
   void exampleFun2(string arg1, int arg2 );
   void sendMemberFun();
};

void Example::sendMemberFun()
{
    receiveMemberFun(_______);   // receiveMemberFun is in other file.
}

I need to pass exampleFun and exampleFun2 member functions to receiveMemberFun. Could anyone explain how receiveMemberFun can be constructed to receive these 2 functions? and what are the possible arguments?

Aucun commentaire:

Enregistrer un commentaire