How to pass a method as parameter ?
<p>i have this class :</p>

<pre><code>class Automat
{
private:
    list&lt;string&gt; listQ ; 
    list&lt;char&gt; listCharacters  ;
    string startQ ; 
    list&lt;Lamda*&gt; listLamda ; 
    list&lt;string&gt; accQ  ;
public:
    Automat();
    ~Automat();
    void addQ(string&amp; newQ) ; 
    void addCharacter(char&amp; newChar)  ;
    void addLamda(Lamda&amp; newLamda) ; 
    void setStartSituation(string&amp; startQ) ; 
    void addAccQ(string&amp; newQ) ;
    bool checkWord(string&amp; wordToCheck) ; 
    friend istream&amp; operator &gt;&gt; (istream &amp;isInput, Automat &amp;newAutomat);
    string&amp; getSituation(string&amp; startSituation) ; 
};
</code></pre>

<p>and i have also this function in class <code>Menu</code> :</p>

<pre><code>void Menu::handleStringSituations(string &amp;stringOfSituation , Automat* autoToHandle ,void (Automat::*methodToDo) () )
{
    int i = 0 ; 
    string newQstring ; 
    newQstring.clear() ; 
    char tempChar ; 
    while (stringOfSituation[i] != '/n') 
    {
         newQstring+=stringOfSituation[i] ;
         ++i;
         if (stringOfSituation[i] == ',')
         {
             ++i ;
            (*autoToHandle).*methodToDo() ; 

             newQstring.clear() ;
         }

    }
}
</code></pre>

<p>the follow line has an error :</p>

<pre><code>(*autoToHandle).*methodToDo() ;
</code></pre>

<p>as you can see a try to pass a method from <code>Automat</code> class as a parameter to <code>handleStringSituations</code> function.<br>
what that i try doesn't work .<br>
i want to use <code>handleStringSituations</code> that i can pass every method from <code>Automat</code> , include methods that have parameters . </p>

<p>someone suggest to multiple the declarations of handleStringSituations according to every type ,<br>
like this :  </p>

<pre><code>void handleStringSituations(string &amp;stringOfSituation , Automat* autoToHandle ,void (Automat::*methodToDo) ()) ;
void handleStringSituations(string &amp;stringOfSituation , Automat* autoToHandle ,void (Automat::*methodToDo) (string&amp;)) ;
void handleStringSituations(string &amp;stringOfSituation , Automat* autoToHandle ,void (Automat::*methodToDo) (Lamda&amp;)) ;
</code></pre>

<p>but it still doesn't work ...<br>
what you are suggesting ?<br>
thanks in advance ..</p>
