关于strlen问题
#include<stdio.h>#include<stdio.h> //提供strlen()函数的原型
#define PRAISE "What a super marvelous name!"
int main(void)
{
char name[40];
printf("What's you name?\n");
scanf("%s",name);
printf("Hellow, %s ,%s\n",name ,PRAISE);
printf("Your name of %d letters occupies %d memory cells .\n",strlen (name),sizeof name);
printf("The phrase of praise has %d letters",strlen (PRAISE));
printf("and occuples %d memory cells.\n",sizeof PRAISE);
return 0;
}
gcc -Wall 3.c -o 3编译后的警告
3.c: In function ‘main’:
3.c:11: warning: implicit declaration of function ‘strlen’
3.c:11: warning: incompatible implicit declaration of built-in function ‘strlen’
希望给点提示能消除警告