How do I prevent holding when reading stdin?

I'm creating a program with glut that uses the terminal for input and using fscanf() is holding up the process. How can I check the stream before calling fscanf()?

Recommended Answers

All 3 Replies

You could try googling non-blocking I/O.

Using select is a viable approach on some systems. There are other input query mechanisms on other platforms. What system are you operating in?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.