xlinuks
January 24th, 2008, 08:35 PM
Hi,
when compiling this C code, gcc does compile the code but issues warnings
#include <string.h>
main() {
char str[] = "Hi there\n";
printf( "%s", str );
}
test.c: In function ‘main’:
test.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
Does anyone know how to get rid of them, am i doing something wrong?
Oh nevermind, I had to include <stdio.h>
when compiling this C code, gcc does compile the code but issues warnings
#include <string.h>
main() {
char str[] = "Hi there\n";
printf( "%s", str );
}
test.c: In function ‘main’:
test.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
Does anyone know how to get rid of them, am i doing something wrong?
Oh nevermind, I had to include <stdio.h>