i wrote this code:
printf("enter a string: ");
scanf("%s",C); // C= "Hello world this is a string"
printf("%d\n",strlen(C));
temp=com0(C);
this code shows that the length of the string is 5 which also mean that is the length of the first word only i have to get the full length but that's not the point the important thing is i have to pass the whole string to the function which also print the length of the first word only and it should print the whole length instead
this is the code of the function:
bool com0(char k[]){
printf("%d\n",strlen(k));
if(k[0]>='a' && k[0] <= 'z'){
return com1(nextchar(k+1));
}
else{
return false;
}
}
it prints 5 also !
and this the result of execution: