title: c++ member function pointer problem
body: <p>I'm new to c++ . I want to know about object pointer and pointer to member function . I wrote a code which is following:</p>
  
  <p>code :</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class golu
  {
     int i;
  public:
     void man()
     {
        cout&lt;&lt;"\ntry to learn \n";
     }
  };
  int main()
  {
     golu m, *n;
     void golu:: *t =&amp;golu::man(); //making pointer to member function
  
     n=&amp;m;//confused is it object pointer
     n-&gt;*t();
  }
  </code></pre>
  
  <p>but when i compile it it shows me two error which is following:</p>
  
  <pre><code>pcc.cpp: In function ‘int main()’:
  pcc.cpp:15: error: cannot declare pointer to ‘void’ member
  pcc.cpp:15: error: cannot call member function ‘void golu::man()’ without object
  pcc.cpp:18: error: ‘t’ cannot be used as a function.
  </code></pre>
  
  <p>my question are following :</p>
  
  <ol>
  <li>What I'm doing wrong in this code ?</li>
  <li>How to make object pointer ?</li>
  <li>How to make pointer to member function of a class and how to use them ?</li>
  </ol>
  
  <p>Please explain me these concept.</p>