SyntaxFix
Write A Post
Hire A Developer
Questions
You need to #include <stdlib.h>. Otherwise it's defined as int malloc() which is incompatible with the built-in type void *malloc(size_t).
#include <stdlib.h>
int malloc()
void *malloc(size_t)