0

I working with an application written in Visual Studio C++. Then program is a console application running under the DOS-prompt. The program is something like this.

void main ()
{
    for ( ;; )
    {
        do_something ();
        do_something_more ()
    }
}

Now I need to add some code between do_something () and do_something_more () that checks if any key on the PC-s keyboard is pressed, and if so read that key. The problem is that the program must continue with do_something_more () if no key is used. I can not wait for the keypress, the program must continue executing as before if no key is pressed. I have not been able to figure out how to do this for this type of application. Anybody can give me a hint of how to do this?

5
Contributors
5
Replies
10
Views
5 Years
Discussion Span
Last Post by richieking
0

And main() is NOT void. It's int.

Votes + Comments
Read well in the future the post and ake sure that you see the similarities before flagging bad post. i dont want to do this but you refused to read carefuly the(my) post before you flagged.
-1

And always main() must be int method not void as it returns a value.

Votes + Comments
You must work with the Department of Redundency Department. Am I not clear? Do you people have to repeat everything that I say?
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.