+ 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

6th Jan 2020, 12:49 AM
priyesh
priyesh - avatar
2 odpowiedzi
+ 2
ya! i included and also trying to print it by puts(s) // my identifier, but no output
6th Jan 2020, 1:43 AM
priyesh
priyesh - avatar
+ 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);
6th Jan 2020, 1:36 AM
Ipang