title: how to ( pascal : procedure of object ) in c++
body: <p>I want to pass a class function as a parameter of C function 
  in Pascal. It is achieved with the keyword (procedure of object) so the compiler will take care of 'this' parameter.
  But it seems complicated in c++.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  typedef void (*func)(void);
  
  class Class{
  public:
      void sub(void)
      {
        printf("Foo");
      }
  };
  
  void test(func f)
  {
    f();
  }
  
  int main()
  {
   Class c;
   test(c.sub);
  }
  </code></pre>