Newbie Help

This is a discussion on Newbie Help within the C++ Programming forums, part of the General Programming Boards category; Hi everyone. Please forgive me if this seems too simple or too easy of a question, but I'm really stuck ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    27

    Newbie Help

    Hi everyone. Please forgive me if this seems too simple or too easy of a question, but I'm really stuck and my teacher isn't of much help. Using Bloodshed as my compilier. Anyway the problem comes when I'm trying to copy a program down from my book into bloodshed. The line of code is:
    std::cout << "Happy Birthday" << std::end1;
    but the error I get says :

    main.cpp:5: error: `end1' is not a member of `std'
    How can I go about fixing this error? Again, thank you for any help you might have, and I apologize if this question doesn't belong in this forum.

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    29
    replace end1 by endl (there exists no end1, endl stands for end line)

    Wow... i replied to this question after 3 mins of posting yeah to me

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    When I first started C++ I had the same error. It is easy to make as a noobie as
    the l does look like a 1. Once yu know how it is written, it is highly unlikly you will make the same error again

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    19
    instead of using std:: cout << "Hello";

    simply add the line: using namespace std; after the included libraries, this way you won't have to add the std:: line.

  5. #5
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I thought copying the tutorial text into another text editor to distinguish the l from 1 using a better font was basic computer literacy?
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    >> instead of using std:: cout << "Hello"; simply add the line: using namespace std; after the included libraries, this way you won't have to add the std:: line.

    While it is true that you can do this, it is not necessarily better. IMO it is better just to use the std::.

  7. #7
    Registered User
    Join Date
    Jan 2006
    Posts
    27
    Everyone, thanks for your help. The text in the book had the "l" (el) character looking like a 1. Everything works fine now. Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. newbie: array question :(
    By cstudent in forum C Programming
    Replies: 2
    Last Post: 04-09-2008, 06:46 AM
  2. getting to grips with allegro and ms vc++ (newbie)
    By jimjamjahaa in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2005, 06:49 PM
  3. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 11:53 AM
  4. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 07:44 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM

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