Instead of pointer char *s
if I use array char s[100]
(in line 4) the code gets executed. Why is that?
#include<stdio.h>
int main(){
int l=0;
char *s;
printf("enter string : \n");
fgets(s,100,stdin);
puts(s);
while(s[l]!='\0'){
l++;
}
printf("length : %d",l-1);
return 0;
}