Help for a beginner


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help for a beginner

  1. #1
    Join Date
    Dec 2005
    Posts
    5

    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:

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

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    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 01:33 PM.

  3. #3
    Join Date
    Dec 2005
    Posts
    5
    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, 12:12 PM
  2. working on ASP as a beginner!
    By sahar in forum ASP.NET
    Replies: 2
    Last Post: 12-10-2000, 07:18 PM
  3. Re: (Thanks)New Beginner Tutorials
    By FlSteve in forum vb.announcements
    Replies: 1
    Last Post: 09-14-2000, 03:49 PM
  4. New Beginner Tutorials
    By Burt Abreu in forum vb.announcements
    Replies: 0
    Last Post: 09-08-2000, 03:29 AM
  5. New Beginner Tutorials
    By Burt Abreu in forum vb.announcements
    Replies: 0
    Last Post: 07-26-2000, 01: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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