title: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|
body: <p>See the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std;
  
  class ex
  {
   public:
      int x;
      int y;
      double z;
      ex()
      {
       cout&lt;&lt;"constructor";
      }
      ~ex()
      {
           cout&lt;&lt;"destructor";
      }
  };
  
  int main()
  {
     void *pt=malloc(sizeof(ex)*2);
  
     ex *p,*p1;
     p=new(pt) ex();
     p1=new(pt+sizeof(ex)) ex();
     p-&gt;x=4444;
     p-&gt;y=3333;
     p-&gt;z=65.87879898;
     p1-&gt;x=55555;
     p1-&gt;y=66666;
     p1-&gt;z=6666.6666666;
     cout&lt;&lt;"\nP: "&lt;&lt;p-&gt;x&lt;&lt;"\n"&lt;&lt;p-&gt;y&lt;&lt;"\n"&lt;&lt;p-&gt;z&lt;&lt;"\n";
     cout&lt;&lt;"\np1: "&lt;&lt;p1-&gt;x&lt;&lt;"\n"&lt;&lt;p1-&gt;y&lt;&lt;"\n"&lt;&lt;p1-&gt;z&lt;&lt;"\n";
     p-&gt;~ex();
     p1-&gt;~ex();
  
     free(pt);
     return 0;
  }
  </code></pre>
  
  <p>It shows warning. 
          warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]|</p>
  
  <p>There is any way to overcome that or the code is wrong.
  note:That code displays correct output.</p>
  
  <p>Thank you for helping.</p>