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.
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 :D
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
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.
I thought copying the tutorial text into another text editor to distinguish the l from 1 using a better font was basic computer literacy?
>> 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::.
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.