PDA

Click to See Complete Forum and Search --> : input in C


daveyboy
Mar 21st, 2002, 04:34 AM
within C if I use the scanf() function, how do I allow the user to enter a null value? So far if I use scanf to input, and just press return, it continually requests input until it is non null

Any suggestions?

Dave.

CornedBee
Mar 21st, 2002, 07:47 AM
Use gets (or better fgets) and parse the string with sscanf.