where i place that function?

Dec 5, 2008 at 10:48pm
Guys i got a program i made buts its too long so im sending u the url to it :D
i need to place in a quit function help me plz ( tryed alot before)


The url is :
http://pastebin.com/m360474ad

its just a site that shows u my code no need to download anything :)
Dec 5, 2008 at 10:55pm
*Jaw drops*
What in the name of God have you done? Ugh... My brain!

Anyway, I think void exit(int) is what you're looking for.
Dec 7, 2008 at 7:42pm
Its in french :)! lol .... anyways where? :S... i tryed making an exit function didnt work pale! i need a place to put it in :P!
in int main :D lol
Dec 7, 2008 at 8:22pm
No, I meant all those ifs. Just awful.

What you needed was a function that would terminate the program no matter how deep in the call stack it was, right? Just make a call to exit() where you need to terminate.
Dec 8, 2008 at 10:57am
lol not really i just need a function that works if i press a button :D... ex:
i pressed ESC anytime in the program it should close
it doesnt work i tryed many functions
Dec 8, 2008 at 5:13pm
OOOOhhhhh........

Well, that's something completely different. You never mentioned that, before.

There's nothing in the standard library that will allow you to do that. To do it, you'll need threads and some system-dependent function that will tell you which key's are being pressed. I think the function in Windows was GetAsyncKeyState().
Topic archived. No new replies allowed.