C Quirk??
Kurt Zeilenga
kurt at hi.unm.edu
Sat Feb 6 08:51:52 AEST 1988
In article <804 at PT.CS.CMU.EDU> edw at IUS1.CS.CMU.EDU (Eddie Wyatt) writes:
>Not that this requires a net response, I just like reading my posts :-)
>
>#define clearline() while (getchar() != '\n')
>ch = getchar();
>clearline();
>Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu
If you want to read the whole line (like for a command line parser),
then I would suggest using fgets() or gets() and then using scanf to
grab out whatever you wanted. Examples? try K&R.
--
Kurt (zeilenga at hc.dspo.gov)
More information about the Comp.lang.c
mailing list