Menu

dev c++ can't run program

2011-03-22
2012-09-26
  • Khustarico De angelo

    Hi

    Please help as I cannot run my program. I have compiled successfully however,
    the console window does'nt remain open even though the "Environment Options"
    are correctly selected.

     
  • Steve A

    Steve A - 2011-03-30

    Console mode apps don't ordinarily run from the desktop.
    What you are experiencing:
    a) click on your .exe,
    b) console flashes and
    c) console disappears,
    is completely normal.

    You have two (2) options:
    1) learn how to open a dos console and change directories to your working sub-
    directory,
    2) add the following code to the very bottom of your "main()" function:

    int main()
    {
        // do stuff
    
        system("PAUSE");
        return 0;
    }
    

    That will allow the console window to remain open until you respond.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.