+ 1
explain me the working of fgets() ??
i used it in a code as : char s[10]; fgets(s,10,stdin); // it's not working https://code.sololearn.com/c3OZ2VFaTMfv/?ref=app
2 odpowiedzi
+ 2
ya! i included and also trying to print it by puts(s) // my identifier, but no output
+ 1
Was there any error message?
Did you include <stdio.h> ?
It should work I think. Maybe you just forgot to print the variable <s>.
printf("%s\n", s);