Substitute for gets()

Guy Harris guy at auspex.UUCP
Thu Feb 9 21:30:28 AEST 1989


 >I mean, gets() in such a loop does just fine, ie it would return "foo
 >bar", but I have yet to kludge up a functionally equivalent scanf().
 >
 >Does this mean gets() is indispensable ? 

No, it means no such thing.  Look under "f", as in "fgets()" in your
reference manual.  Yes, it leaves a '\n' at the end of the line, but
it's not *that* big of a pain to remove it.



More information about the Comp.lang.c mailing list