can any one tell me how we can perform 2 tasks simultaneously in a C program.i.e.,to read a character during runtime.
Re: Help!!! Use a more descriptive subject line and read the "Before you make a query" thread. Then think. Then ask what you really want to know. Most characters are read during runtime, doanchano.
Re: Help!!! i am making a letter fall from top to bottom of screen.during the time of fall i have to accept a character from user and check it with the letter falling.
actualy me & adroit r programming for individually for TYPE WRITER GAME in this game we r making each letters fall fall from top to bottom in a loop but for the game we need to accept a charccter in same loop only once during the time of fall but not for each & every iteraton of loop .i hope u got us??
Is the letter to continue dropping while the program waits for the input? If so what you want is a multithreaded program. I'm not going to post the complete solution here because there are many ways to do this. However I'll give you the concept. In a multithreaded program one thread does one task while another thread does another. So in this case, before you start the loop you'll start a thread ("spawn a thread" in the jargon) that asks the user for his input. When he gives it the thread terminates. Like I said there are many ways to acheive multithreading. The simplest is to use Windows's CreateThread function (documentation available online). If you want to your program to work on other OSs you should download a C thread library. (I don't know of any I can recommend).
Actually, you don't even need a thread. You can have character input raise an event. Neither threads nor events are a part of the C/C++ languages, so how you do this is implementation dependent.