int main(){
char s[1000];
s[0]='Q';
printf("%d",strlen(s));
return 0;
}
The above code is giving 6 as output. The output should be 1 in this case.
int main(){
char s[1000];
printf("%d",strlen(s));
return 0;
}
This code was even giving 6 as output. where it should be 1000 or 0 or some garbage value. I have tried it in " hackerrank ", but it was giving 6 as the length. When the same code was tried in TURBOC it was giving the correct answer. I was unable to find the reason for this output. Can someone please sort it out and give the exact solution to this problem.