related codes
//
-sharpinclude <stdio.h>
-sharpdefine N 100
int strlen( char string[])
{
int i=0;
while(string[i]!="\0") iPP;
return i;
}
int main()
{
char string[N];
scanf("%s",string);
int r=strlen(string);
printf("%d\n",r);
return 0;
}
what result do you expect? What is the error message actually seen?
for example, this program does not add a header file < string.h >. It does pop up a warning when compiling: [Warning] conflicting types for built-in function "strlen"
but there is no warning if you change the function name strlen to mystrlen. Why?