November 10th, 2002, 06:12 PM
How do you tell a program to exit when you press a cetain button in C++
The Many Signatures Of Me
[gloworange]Moses Anderson[/gloworange]Moses Anderson
November 10th, 2002, 06:47 PM
cout << "Hello World!" << endl;
cout << “Press ENTER to continue…”;
November 10th, 2002, 06:51 PM
When you say "button" do you mean "key" or a button as in a graphical interface (meaning you are doing Visual C++ )
Credit travels up, blame travels down -- The Boss
November 10th, 2002, 07:10 PM
You should implement a kind of "event listener" .. a bit of code which looks after all the events in the sistem and runs continuously with your application, better as a separate thread. Then, when the keyboard is touched on the corresponding key, or the screen button is pressed -as U like- the listener will trigger the program exit (freeing the memory, closing all opened files, eventually closing used network connections, and so on).
Wh .. oops! Let\'s start over!
November 10th, 2002, 08:50 PM
BurnByThee, Why the heck did you post the same thread twice only with a different name? You could have and should have atleast given peaple time to post instead of being such a impatiant thread poster.