title: Dereferencing Void Pointer that will point to a structure
body: <p>I have the following structures: </p>
  
  <pre><code>typedef struct TTCAPMessage {
          uint8_t packagetype; //{should be Query /w Permission or Response}
          uint32_t transid; //{transaction ID number}
          std::vector&lt;TTCAPComponent_t&gt; components; //{a string of component Information elements}
          bool parseok; //{false if error occured}
  } TTCAPMessage_t;
  
  typedef struct TTCAPComponent {
          uint8_t componenttype; //{should be Invoke, Return Result, Reject, etc.}
          uint8_t componentid; //{component ID code}
          uint8_t operationcode; //Query operation code, "Private TCAP"
          void* pParameterSet;
  } TTCAPComponent_t;
  
  typedef struct myStruct {
        .....
  } mySruct_t;
  </code></pre>
  
  <p>In TTCAPComponent_t, there is a void * that is supposed to point to two different types of structures. In this case it will point to myStruct_t. I want to retrieve the data within it. </p>
  
  <p>So to dereference I've tried many variations of the following with no luck:</p>
  
  <pre><code>tcapMessage-&gt;components[0]-&gt;(myStruct_t*)pParameterSet-&gt;(Accessing Structure data) ....
  </code></pre>
  
  <p>I've tried finding resources online but for some reason I cannot get this to work. Thanks in advance for your help!</p>