Closing the program

hi there i am putting the finishing touches on my game and testing the end game functions by tying them into the first page you access.

however when i run it, it closes the end result but keeps running instead of closing down..

how can i fix this?
I forgot to mention that my game contains 22 .cpp files so the idea is that no matter how many have been accessed the game will close
by tying them into the first page you access.

What?

I forgot to mention that my game contains 22 .cpp files so the idea is that no matter how many have been accessed the game will close

The number of files in your project has nothing to do with exiting the program.
You exit the program by returning from main.
what i ment was that instead of going through the whole game (i.e. cabin to bridge to engine core...etc.) completing the tasks, i made the cabin cpp connect directly to an end screen.

currently my game only uses the main.cpp like only for the title.

i then link my cabin.cpp via the global bool cabin(); prototype;

which then uses all the code on that page, normally it links to a different cpp after that, however i linked one of my end game events.

as for ending it, i was able to find the simplest way, only didn't know it cause we hadn't done that chapter in the book.... since it is the last chapter

i just input
1
2
3
keep_window_open();
exit(0);
return 0;


or true depending if it is an int or bool
but thanks for the help none the less, your comment got me to think about old lessons and helped me find the info i was looking for!
Topic archived. No new replies allowed.