G
gdotone
#include <stdio.h>
#include <stdlib.h>
#define MAXSTRING 100
int main(int argc, const char * argv[])
{
char c = 'a', *p, s[MAXSTRING];
p = &c;
printf ("%c%c%c \n", *p, *p + 1, *p + 2);
strcpy(s, "ABC");
printf ( "%s %c%c%s\n", s, *s + 6, *s + 7, s + 1 );
strcpy(s, "she sells sea shells by the seashore" );
p = s + 14;
for ( ; *p != '\0'; ++p )
{
if ( *p == 'e' )
*p = 'E';
if ( *p == ' ' )
*p = '\n';
}
printf ( "%s\n\n", s );
return 0;
}
This program come from "A Book on C"
When I compile this program I get a warning from the compiler.
Implicitly declaring C library function 'strcpy' with type 'char*(char *, const char *)'
The compiler is LLVM 3.1
Why am I getting this warning? What does it mean? How can it be fixed so that there is no warning given?
Thanks, everyone.
#include <stdlib.h>
#define MAXSTRING 100
int main(int argc, const char * argv[])
{
char c = 'a', *p, s[MAXSTRING];
p = &c;
printf ("%c%c%c \n", *p, *p + 1, *p + 2);
strcpy(s, "ABC");
printf ( "%s %c%c%s\n", s, *s + 6, *s + 7, s + 1 );
strcpy(s, "she sells sea shells by the seashore" );
p = s + 14;
for ( ; *p != '\0'; ++p )
{
if ( *p == 'e' )
*p = 'E';
if ( *p == ' ' )
*p = '\n';
}
printf ( "%s\n\n", s );
return 0;
}
This program come from "A Book on C"
When I compile this program I get a warning from the compiler.
Implicitly declaring C library function 'strcpy' with type 'char*(char *, const char *)'
The compiler is LLVM 3.1
Why am I getting this warning? What does it mean? How can it be fixed so that there is no warning given?
Thanks, everyone.