Menu

Never stops compiling

dan meharg
2011-03-13
2012-09-26
  • dan meharg

    dan meharg - 2011-03-13

    Hey guys, I made this simple code, along with many others and cannot seem to
    get it to run. I press "Compile and run" and it seems to just compile forever,
    it never runs it... just keeps compiling, I cannot even cancel it with the
    cancel button. I dont know what up, tried re installing many times now.

    Here is my code... basic stuff

    I am using dev cpp 4.9.9.2

    Thanks for the help,

    Dan.

    //game over

    include <iostream>

    int main() {
    std::cout << "Game over!" << std::endl;
    return 0;

    }

     
  • Ahaan Rungta

    Ahaan Rungta - 2011-03-13

    Hi, Dan.

    This problem does compile. What I did is I clicked "Compile and Run" and it
    compiled and the executable file saved on my desktop. When I went into it, I
    noticed that the program ran for only about a millisecond. Then, I realized
    the error.

    You need to add system ("PAUSE"); somewhere in your program, so that the
    screen does not close right away.

    Try this:

    //game over

    include <iostream>

    int main() {
    std::cout << "Game over!" << std::endl;
    return 0;
    system ("PAUSE");
    }

     

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.