title: Typecasting a void pointer in a Linked List
body: <p>I have an array of structs called arrayOfElements and I want them stored ( in better terms pointed to ) in a Linked List so I've malloc'd the arrayOfStrucs</p>
  
  <pre><code>arrayOfElements= malloc(4 * sizeof(Element));
  </code></pre>
  
  <p>and then once I have put in all the data in I want to pass it to a function called insert which imports the head of the list and the array of structs</p>
  
  <pre><code>LinkedList* insert(LinkedList* head, Element* inArrayOfElements)
  </code></pre>
  
  <p>My issue is that I've been told that the data member in the linked list has to be a void* , thats a hard requirement. So my question is, in the function insert how do I go about making void* data from the linked list </p>
  
  <pre><code>typedef struct LinkedList {
      void* data
      struct LinkedList* next;
      } LinkedList;
  </code></pre>
  
  <p>point to the imported array of structs?</p>
  
  <pre><code>LinkedList* insert(LinkedList* head, Element* inArrayOfElements)
  { 
      LinkedList* insertNode = malloc(sizeof(LinkedList));
      insertNode-&gt;next = head;
      /*WHAT DO I DO HERE TO MAKE void* data point to inArrayOfELements*/
      return insertNode;
  }
  </code></pre>