title: Malloc invalid conversion from 'void*'
body: <p>I don't know much about malloc and I know there are similar questions but I still wanted to ask.</p>
  
  <p>When I compiled my code I came across these errors</p>
  
  <pre><code>scheduler.c: In function 'char* addprocess(char*, FILE*)':
  scheduler.c:127:60: error: invalid conversion from 'void*' to 'process*'
  scheduler.c:135:38: error: invalid conversion from 'void*' to 'char*'
  scheduler.c:170:65: error: invalid conversion from 'void*' to 'event*'
  scheduler.c: In function 'int main()':
  scheduler.c:381:52: error: invalid conversion from 'void*' to 'stat*'
  *** Error code 1
  make: Fatal error: Command failed for target `all'
  </code></pre>
  
  <p>Here are the lines from the code.</p>
  
  <pre><code>127     struct process* newproc = malloc(sizeof(struct process));
  135     newproc-&gt;name = malloc(line-pos-1);
  170     struct event* newevent = malloc(sizeof(struct event));
  381     statistics = malloc(amount* sizeof(struct stat));
  </code></pre>
  
  <p>What does it mean when it say invalid conversion and why. Also what is the best solution to these errors.</p>