title: Cannot seem to cast void* to struct in c++
body: <p>I have a very simple method with the following prototype:</p>
  
  <pre><code>void *station_0(void* p1);
  </code></pre>
  
  <p>I am calling it like this:</p>
  
  <pre><code>product_record r;
  pthread_create(thread, NULL, station_0, (void *)&amp;r);
  </code></pre>
  
  <p>Inside this method all I need to do is cast <code>p1</code> to an already defined struct <code>product_record</code>, I am currently trying this inside of my method:</p>
  
  <pre><code>product_record p = (product_record)p1
  </code></pre>
  
  <p>but the compiler complains on that line(above) saying <code>error: invalid conversion from 'void*' to 'int' [-fpermissive]</code></p>
  
  <p>I don't think I understand this warning at all. Why cannot I simply cast a  <code>void*</code> to my struct? </p>