DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005

    Help for a beginner

    Hello, I'm just getting started with C++. I got the program Dev-C++.
    I bought a book for complete beginners. But I can't even get the first example [ Hello World ] right. All that happens when I compile and run it is that I see a window appearing on the screen and then disappearing really fast again.
    Here's the code:

    #include <iostream>
    using namespace std;
    int main()
     cout << "Hello World\n";
     return 0;

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    Most everyone who has used Dev-C++ has faced this, too.

    One of the methods which will allow you to view the console (in a DOS or Windows version) is, before your return statement, add this statement to your main method:

    system( "pause");

    It freezes the display with an operating system message "Press any key to continue".

    This is one of the items contained in the Dev-C++ FAQ files which are included with the IDE - go to help, index, type in FAQ ...
    Last edited by nspils; 12-17-2005 at 12:33 PM.

  3. #3
    Join Date
    Dec 2005
    Ah yes, that works.
    Thanks a lot! :)

Similar Threads

  1. Beginner of Java Programming
    By Clark in forum Java
    Replies: 1
    Last Post: 02-21-2001, 11:12 AM
  2. working on ASP as a beginner!
    By sahar in forum ASP.NET
    Replies: 2
    Last Post: 12-10-2000, 06:18 PM
  3. Re: (Thanks)New Beginner Tutorials
    By FlSteve in forum vb.announcements
    Replies: 1
    Last Post: 09-14-2000, 02:49 PM
  4. New Beginner Tutorials
    By Burt Abreu in forum vb.announcements
    Replies: 0
    Last Post: 09-08-2000, 02:29 AM
  5. New Beginner Tutorials
    By Burt Abreu in forum vb.announcements
    Replies: 0
    Last Post: 07-26-2000, 12:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.