#include <stdio.h>
int stringLength(char s[]);
int main()
{
char a[50];
int y;
setvbuf(stdout,NULL,_IONBF,0);
printf("Please input the string:");
scanf("%s",a);
y=stringLength(char a[]);
printf("The length of the string is %d",y);
}
int stringLength(char s[])
{
int i=0;
while(s[i]!='\0')
i++;
return i;
}
10:05:41 **** Incremental Build of configuration Debug for project W10T24R130026150 ****
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\W10T24R130026150.o" "..\src\W10T24R130026150.c"
..\src\W10T24R130026150.c: In function 'main':
..\src\W10T24R130026150.c:20:20: error: expected expression before 'char'
20 | y=stringLength(char a[]);
| ^~~~
10:05:41 Build Failed. 1 errors, 0 warnings. (took 170ms)