title: How to pass a member of class to another member of another class
body: <p>I have a problem. I have two classes and I need to pass the member of one as a parameter to another member of the other class, like this:</p>
  
  <pre><code>class A{
  public:
        int functionA(string x);
  .
  .
  .};
  </code></pre>
  
  <p>And</p>
  
  <pre><code>class B{
  public:
      void functionB( /*here would go functionA*/);
  .
  .
  .
  };
  </code></pre>
  
  <p>This is how <code>functionB(...)</code> would look.</p>
  
  <pre><code>void B::functionB( /*functionA*/){
  string x = generateString();
  functionA(x);
  .
  .
  .
  }
  </code></pre>
  
  <p>How could I do that? I tried with <code>function&lt;int(string)&gt;&amp; fun</code> but looks like that is not intended when there are classes. I also tried <code>functionB(int(aClass::*func)(string),aClass&amp; a)</code> but same result as before.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks!</p>