Beginner question

This is a discussion on Beginner question within the C++ Programming forums, part of the General Programming Boards category; Today is the first time I started learning C++, or any language for that matter. I'm using Bloodshed Software's Dev-C++. ...

  1. #1
    Unregistered
    Guest

    Beginner question

    Today is the first time I started learning C++, or any language for that matter.

    I'm using Bloodshed Software's Dev-C++. The tutorials offered here said to copy some example code into a file (which is what I have, right?), save the file, and then open the file in a compiler. I thought I did this all right, but when I ran the file, a window just flashed before I could even see what it was. Is that supposed to happen?

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    317
    Yes, just you a system pause to wait for a little or add a
    Code:
                cin.get();
    statement to the end and the console app will stay open until you press enter.

  3. #3
    Unregistered
    Guest
    int main()
    {
    cout<<"HEY, you, I'm alive! Oh, and Hello World!";
    return 0;
    }

    add cin.get () ; here? When I did, errors occured, and it wouldn't run.

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    317
    Sorry about that, guess I should be more specific:
    Code:
    int main()
    {
           cout<<"blah, blah";
           cin.get();
           return(0);
    }

  5. #5
    Unregistered
    Guest
    YAHOO!!! My first crappy program!!! Thanks!

  6. #6
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    heh, i know just where you are... I loved that. I was so happy just to be able to type words on the screen.
    What is C++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner: Linked List question
    By WeatherMan in forum C++ Programming
    Replies: 2
    Last Post: 04-03-2008, 07:16 AM
  2. Quick IF statement question (beginner)
    By jim.rattlehead in forum C Programming
    Replies: 23
    Last Post: 11-29-2007, 05:51 AM
  3. beginner question
    By Barrot in forum C++ Programming
    Replies: 4
    Last Post: 08-19-2005, 02:17 PM
  4. Question About External Files (Beginner)
    By jamez05 in forum C Programming
    Replies: 0
    Last Post: 08-11-2005, 07:05 AM
  5. Beginner on Win32 apps, lame question.
    By Templario in forum C Programming
    Replies: 3
    Last Post: 11-06-2002, 07:39 PM

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