Jump to content
  • Advertisement
Sign in to follow this  
Danishpx

need help on exercise in C++ book

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just bought Beginning C++ Game programming by michael dawson and im on the exercise "lost fortune". I wrote the code and it runs fine,but after it asks for my last name and i press enter it just exits. Why does it exit? please help.

Share this post


Link to post
Share on other sites
Advertisement
Well, why don't you post your code and we'll see if we can help you. Please use the "source" and "/source" tags (in square brackets) to make it tidy.

-fel

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It probably exits because the application finishes running. If you want to see the final output, you should run it in a console window, or add some code that will delay application exit.

Share this post


Link to post
Share on other sites
Quick fix to run it and not have to change any code.

1) Click START->Run
2) Type cmd and hit enter
3) now go to the directory you have your compiled applicaion in and run it from there, that way it won't exit.


You can also do it in code using system("pause") or a getch or whatever :) That way you won't have to drop to a DOS box.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!