DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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 12: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, 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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links