title: pointer and structure with pointers
body: <p>Here is my problem :
  I have a structure :</p>
  
  <pre><code>typedef struct Data_Package{
      int type;
      size_t size;
      void* data;
  }Data_Package;
  </code></pre>
  
  <p>and I have a function : (Edit : Armen Tsirunyan remarks) (it is a .C function)</p>
  
  <pre><code>void myFunc(Data_Package* ioData) {
      ioData-&gt;data = malloc(sizeof(double));
      (ioData-&gt;data)= (double*)62.5
  } //that doesn't work
  </code></pre>
  
  <p>and the main.cpp where I would like to use my function :</p>
  
  <pre><code>Data_Package* ioData=0;
  /* some random operation that change the data,type,... */
  myFunc(ioData);
  
  stc::cout &lt;&lt; *static_cast&lt;double*&gt;(ioData-&gt;data) &lt;&lt; std::endl  //I want to display te value data (and not the address)
  </code></pre>
  
  <p>So I would like to know how to change the value data in my function and then display it in the main.cpp (I need to use pointer and data is void* because it could be double or bool or int or ...)</p>
  
  <p>Thanks a lot.</p>
  
  <p>Drlk.</p>