Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stdin waits for no gets or fgets

Status
Not open for further replies.

PowerNuke

Programmer
Oct 7, 2001
10
0
0
US
I am trying to use:
gets( userInput ); or
fgets( userInput, 21, stdin );

to get a string from the keyboard. Instead of stopping, it blows by the statement leaving a NULL string in its wake! The only thing I can think is that I used scanf earlier in the program. Any troubleshooting suggestions will be appreciated.

Thanks,

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top