title: How to access class members using void pointer(generic) in c++
body: <p>code:I want to access class members function display using generic ptr p...how should i do?</p>
  
  <pre><code>#include "stdafx.h"
  #include&lt;iostream&gt;
  using namespace std;
  class car
  {
  public:  
  int i,j;
    car():i(5),j(9){};
    car(int a,int b):i(a),j(b){}
    void display();
  };
  void car::display()
      {   cout&lt;&lt;i&lt;&lt;j;}
  void main()
  {
     car *obj=new car;
     void *p=obj;
  ***//how to access 'display() or i or j' using 'p'***
  }
  </code></pre>