TITLE: How to politely eat a newline (with pinkey extended, of course) PROBLEM: dougbell@netcom.com (Douglas K. Bell) In the following code, "gets" never executes! Why ??? If the "scanf" is removed, "gets" runs fine. Why ???? ( Argh... ) main() { long serial_number; char buf[80]; scanf( "%ld", &serial_number ); gets( buf ); <<<<<<<<< NEVER EXECUTES !!! WHY ? } RESPONSE: jollie@odie.weeg.uiowa.edu (Jeffrey C. Ollie), 7 Dec 93 gets does execute. The scanf will leave the next input as the first character after the serial number. This is probably '\n'. When gets executes, it sees a '\n' as it's first input, takes this to be the end of a line, and exits. Add "%*[^\n]%*c" to the end of your format string. This will eat everything up intil the end of a line, and then eat the newline.