Let’s start the discussion about malloc is undefined in following Approaches.
Contents
malloc is undefined ?
// You need:
#include<stdlib.h>
I hope the strategies listed above work for you. Happy coding and come back again.
Similar Post : error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode