C programming exception - implicit declaration of function 'free' is invalid in C99

Environment : MAC pro

Problems : abnormal trigger compiler.

main.c:17:9: warning: implicit declaration of function 'free' is invalid in C99 [-Wimplicit-function-declaration]
        free(input);
        ^

Analysis : Because free function declared in stdlib.h header file, so it is necessary to introduce the header files, in order to declare it.

Solve :

#include <stdlib.h>
Published 503 original articles · won praise 1356 · Views 1.88 million +

Guess you like

Origin blog.csdn.net/Jmilk/article/details/105350494