@Learning_man, Experienced C programmers, when using
fgets()
, tend to ignore the potential of reading a
null character and use the input up to the first
null character, be it the read one or appended one. IMO, using extended library functions like
getline()
or ` fscanf(f, "%199[^\n]%n",...` like code are the way to go. —
chux - Reinstate Monica 19 secs ago