954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Looping problem

Hi everyone!
I'm trying to write a program which can run a loop without interrupt but still can accepts input from user anytime.

My program is like this:
A bunch of word will drop down(using looping)
User have to enter letters for each word but the words will still continue drop down without waiting for user input.
After finished enter letters for particular word, the word will be disappeared.

I'm newbie in C++ programming.
What conditions should I consider?
Is this called parallel programming?

Thanks!

jason0202
Newbie Poster
5 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

You can use a thread to run the blocking user input functions at the same time as your other word printing so that the printing is not interrupted.

Or you can use non-blocking user input functions. I would usually use kbhit() to check if the user has pressed a key (without waiting). Note this function is not available in all compilers.

dougy83
Posting Whiz in Training
275 posts since Jun 2007
Reputation Points: 85
Solved Threads: 45
 

Wow, you're great!
U have saved alot of my time from searching the internet.
Thanks for replying!

jason0202
Newbie Poster
5 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You