Date: Thu, 1 Sep 94 12:25:54 -0400 From: dj AT cmdns6 DOT ctron DOT com (DJ Delorie) To: eliz AT is DOT elta DOT co DOT il Cc: ronis AT onsager DOT chem DOT mcgill DOT ca, djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: bug in scanf() > get past the illegal input with scanf("%s", junk) where > junk[] is a character array. I recommend scanf("%*[^\n]\n");, which purges up to the next newline without storing it anywhere.