Need help with C++ - can't get compiler to work properly

Discussion in 'Game Development (Technical)' started by Isaac, Mar 24, 2012.

  1. Isaac

    Isaac New Member

    Jan 28, 2010
    Likes Received:
    Hey there
    I just recently started to try and learn C++, using the book "C++ without fear" by Brian Overland. However, even the simplest of programs just don't work. When I compile and run, the program just pops up for a tenth of a second and then it's gone. The only way I have found to resolve this, is to use cin.get(); before return 0;, however, as I got into more complex programs, I need more and more of those functions. Even for one of the ver early examples in the book, I need 2 of those right after each other, to get it to actually work like it should with none of those.
    So I'm just wondering, there must be another way to get around this? The book mentions nothing of this, and I'm a bit annoyed I have to use all kinds of solutions with complex codes, when I'm just trying to follow a simple tutorial. I'm using Bloodshed Dev-C++ btw, if that makes any difference.

    Thanks in advance

  2. svero

    Moderator Original Member Indie Author

    Jul 27, 2004
    Likes Received:
    Sounds like you're making a command line program. So it pops up a console and then the console goes away when the program is done running. If you wan't to see the output run the program from a console. (run cmd.. navigate to dir where the program is.. run it from there)

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer