removing newline character from the buffer read by fgets



Is there any efficcient way of removing the newline character from the
buffer read by
fgets() ?

Is there any library function that is similar to fgets() but also tells
how many
bytes it read into the buffer ?

.



Relevant Pages

  • system() and _flushall()
    ... You must explicitly flush (using fflush or _flushall) or close any stream ... However, on the next read from the input file using fgets, I get ... forgotten that there's still data in the buffer (the buffer is not destroyed ...
    (microsoft.public.vc.language)
  • Re: *scanf in Harbison and Steele
    ... The difference between fgets and gets is at least that fgets takes ... the output buffer. ... Though I've been told that stdin come with the food in C, must you declare: ...
    (comp.lang.c)
  • Re: Replacing fgets
    ... OK, for the sake of discussion, replacing fgets() with some type ... of equivalent function where you START with a unopened file really ... reset the buffer position. ... if you only want to set buffer position, ...
    (comp.lang.c)
  • Re: Replacing fgets
    ... OK, for the sake of discussion, replacing fgets() with some type ... and you just want to do some simple parsing and searching. ... the START of the line in the buffer, ...
    (comp.lang.c)
  • Re: cat
    ... your buffer size, and thus you could use fgets. ... and since the devices may have different bus speeds, ... This terminates the loop if the fgets() returns NULL. ...
    (comp.lang.c)