title: error incompatible types when assigning to type from type void * in C
body: <p>So this is my header file:</p>
  
  <pre><code>#define VECTOR_INITIAL_CAPACITY 20
  
  struct _Variable {
      char *variableName;
      char *arrayOfElements;
      int32_t address;
  };
  typedef struct _Variable Variable;
  
  struct _VariableVector {
      int size; // elements full in array
      int capacity; // total available elements
      Variable variables[VECTOR_INITIAL_CAPACITY];
  };
  typedef struct _VariableVector VariableVector;
  
  void init(VariableVector *variableVector);
  
  void append(Variable *variable);
  
  Variable* find(char *variableName);
  </code></pre>
  
  <p>and this is my .c file where I am trying to implement the init method:</p>
  
  <pre><code>#include "VariableVector.h"
  
  void init(VariableVector *variableVector) {
      variableVector-&gt;size = 0;
      variableVector-&gt;capacity = VECTOR_INITIAL_CAPACITY;
  
      // allocate memory for variableVector
      variableVector-&gt;variables = malloc(
              sizeof(Variable) * variableVector-&gt;capacity); // &lt;== ERROR HERE
  }
  </code></pre>
  
  <p>The error I am getting above is </p>
  
  <pre><code>incompatible types when assigning to type 'struct Variable[20]' from type 'void *'
  </code></pre>