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

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

  1. Isaac

    Expand Collapse
    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

    Expand Collapse
    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