Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help a n00b

  1. Aug 19, 2005 #1


    User Avatar
    Gold Member

    Every time I compile and run a program in Dev-C++ Command prompt only opens for less than a second and closes immediately. can anyone help?
  2. jcsd
  3. Aug 19, 2005 #2


    User Avatar
    Staff Emeritus


    Type: cmd (assuming your on windows xp)
    Type: cd <directory where program is located>
    Type: <program name>
  4. Aug 19, 2005 #3
    Use getch() ?
    Code (Text):

    int main()
        printf("Hello World");
        return 0;
    -- AI
  5. Aug 19, 2005 #4
    Programs run until they get to the end of the code, use getchar()
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook