How to resolve compiler warning 'implicit declaration of function memset'
c, c++
Solution
You need:
#include <string.h> /* memset */
#include <unistd.h> /* close */
in your code.
References: POSIX for `close`, the C standard for `memset`.
Problem
My c code uses 'memset' and 'close'. And I have added: ``` #include <stdio.h> #include <glib.h> #include <stdlib.h> ``` But I still get these warnings: ``` main.c:259: warning: implicit declaration of function ‘memset’ main.c:259: warning: incompatible implicit declaration of built-in function ‘memset’ main.c:268: warning: implicit declaration of function ‘close’ main.c:259: warning: incompatible implicit declaration of built-in function ‘close’ ``` Can you please tell me how can I resolve these warnings? Thank you.