Dev-C++ Compile and Run with Pause

This is a discussion on Dev-C++ Compile and Run with Pause within the C++ Programming forums, part of the General Programming Boards category; Is there anyway to get Dev-C++ to automatically run a program with a pause at the end of execution instead ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37

    Question Dev-C++ Compile and Run with Pause

    Is there anyway to get Dev-C++ to automatically run a program with a pause at the end of execution instead of having to manually type in the line of code for a pause?

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Dev C++ automatically puts in Pause("SYSTEM") at the end

  3. #3
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37
    No it doesn't. I have to type the line in before the return statement or it finishes execution without letting me see the console window.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    What version of Dev-C++ do you use?

  5. #5
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37
    4.9.9.2

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    is that one of teh version 5 betas?

    I use version 4 which gives me system ("PAUSE")

  7. #7
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37
    Yeah it's a beta

  8. #8
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Ok maybe they got rid of making it show that at the bottom.

  9. #9
    Registered User
    Join Date
    Mar 2006
    Location
    Ohio
    Posts
    37
    Any suggestions as to any editors that I can use that do this that aren't propritary? (i.e. MSVC++)

  10. #10
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    Dev-C++ is a good IDE, I'm not sure you need to leave it over such a small issue. Besides, pausing the program at the end is only something a small number of users actually want to do, so it shouldn't be a surprise that the IDE doesn't do it for you, especially when it is so easy to add it to the program yourself.

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    put it in yourself if you want it in there. and use
    Code:
    std::cout<<"Press [ENTER] to continue\n";
    std::cin.get();
    instead of system("PAUSE");

    The best editors/compilers don't put a pause in there IMO.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  12. #12
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  13. #13
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Location
    Milwaukee, WI, USA
    Posts
    300
    First, you can change the code that is automatically given with any new source code page:

    Tools -> Editor options -> Code tab (at the top) -> Default Source tab (near the bottom)

    Put in something like:
    Code:
    #include <iostream>
    
    int main()
    {
    
       //your pause code here
       return 0;
    }
    Then, when you create a new source code file, that should be ready for you, instead of typing those horrible 16 characters over and over and over and over again!

    Or, presuming you run Windows [edit]and only want it to stay open during testing[/edit], click on start -> run and type cmd. Change the directory to the one containing what will be your executable, and run it from there after you compile. When the program is complete, the shell will stay put.
    Last edited by Decrypt; 03-29-2006 at 11:00 PM. Reason: clarification
    There is a difference between tedious and difficult.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 07-13-2008, 08:16 PM
  2. Replies: 5
    Last Post: 10-25-2007, 12:27 PM
  3. Dev C++ Won't Compile
    By mburt in forum Windows Programming
    Replies: 8
    Last Post: 08-21-2006, 11:14 PM
  4. Cant compile and run
    By Vente in forum C++ Programming
    Replies: 5
    Last Post: 12-27-2005, 01:11 PM
  5. Replies: 4
    Last Post: 11-14-2001, 09:28 AM

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