Incompatible implicit declaration of built-in function ‘malloc’ Incompatible implicit declaration of built-in function ‘malloc’ c c

Incompatible implicit declaration of built-in function ‘malloc’


You likely forgot to #include <stdlib.h>


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).


You're missing #include <stdlib.h>.