Code:
warning: implicit declaration of function `malloc'
warning: implicit declaration of function `strlen'
warning: implicit declaration of function `strcpy'
I am getting these messages when I compile my files with: gcc -Wall -ansi -pedantic -O *.c.
But if I compile with just gcc *.c the program compiles fine and works fine.
the lines that cause the message are:
Code:
p=(char*)malloc(strlen(buffer)+1);
strcpy(p,buffer);
Could you tell me what is wrong and what is the right way to do it? Thanks in advance.