malloc is undefined
snippet in c

malloc is undefined

user8212

// You need:
#include <stdlib.h>