> >
> >#define clearline() while (getchar() != '\n')
>
> This is seriously bad code. What if stdin reaches end of file?
>
It loops forever -- oops. Change that to
#define clearline() while (1) {int ch = getchar(); \
if ((ch == EOF) || (ch =='\n')) break; }
--
Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu