C++ Compiler problem...

This is a discussion on C++ Compiler problem... within the C++ Programming forums, part of the General Programming Boards category; Hi, i'm a new guy and been learning the basics of C++. I got a complier that is well known ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    2

    Post C++ Compiler problem...

    Hi, i'm a new guy and been learning the basics of C++. I got a complier that is well known (Dev-C++) but there is a problem. Whenever I Run my program after I compile it, the CMD PROMPHT shows up and then closes, showing just a million secound of my program. So basicly, it starts the program and closes it. Anyways, Is there any code or anything that I can do to keep the window up? Thanks guy, later

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,630
    Note that Dev-C++ is not a compiler but an IDE. As for your problem, read How do I Stop my Windows Console from disappearing everytime I run my program?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    This is covered in the FAQ. Essentially, you need an input function to wait for a keypress, or you can run the application from the command line itself.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    2
    oh okay, that makes sense. Thanks guys

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev-C++ compiler problem
    By GrasshopperEsq in forum C++ Programming
    Replies: 19
    Last Post: 05-08-2008, 02:35 AM
  2. Compiler Problem
    By sitestem in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2004, 03:48 PM
  3. Replies: 5
    Last Post: 12-03-2003, 04:47 PM
  4. Problem with compiler
    By knight543 in forum C++ Programming
    Replies: 4
    Last Post: 02-09-2002, 08:16 PM
  5. Please help me with this compiler problem
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2002, 04:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21