I just got into learning c++ two days ago and yesterday I purchased the book "learn c++ in 21 days". I got passed day one no problem. Read day 2 (today) and understood it pretty well. Now comes my problem. I am using the Dev Bloodshed c++ editor + compiler. When I try to compile the following code (listed below this paragraph). I get the following error(s).
UNIT: 9 h:\docume~1\ajm~1.aar\desktop\chapter2.cpp
MESSAGE: `::end1' undeclared (first use here)"
AND
UNIT: 11 h:\docume~1\ajm~1.aar\desktop\chapter2.cpp
MESSAGE: confused by earlier errors, bailing out
What do these errors mean and what am I doing wrong. According to my knowledge im copying this DIRECTLY from the book as it says I should. Also does anyone have some tips on learning c++. Thanks. (below is the code im trying to compile)
// Listing 2.2 using std::cout
#include <iostream>
int main()
{
std::cout << "Hello there.\n";
std::cout << "Here is 5: " << 5 << "\n";
std::cout << "The manipulator std::end1 ";
std::cout << "writes a new line to the screen.";
std::cout << std::end1;
std::cout << "here is a very big number:\t" << 70000;
std::cout << std::end1;
std::cout << "Here is the sum of 8 and 5:\t" << (8+5) << end;
std::cout << 8+5 << std::end1;
std::cout << "Here's a fraction:\t\t";
std::cout << (float) 5/8 << std::end1;
std::cout << "And a very very big number:\t";
std::cout << (double) 7000 * 7000 << std::end1;
std::cout << "Dont forget to replace Jesse Liberty";
std::cout << "With your name...\n";
std::cout << "Aaron McBride is a C++ programmer!\n";
return 0;
}
UNIT: 9 h:\docume~1\ajm~1.aar\desktop\chapter2.cpp
MESSAGE: `::end1' undeclared (first use here)"
AND
UNIT: 11 h:\docume~1\ajm~1.aar\desktop\chapter2.cpp
MESSAGE: confused by earlier errors, bailing out
What do these errors mean and what am I doing wrong. According to my knowledge im copying this DIRECTLY from the book as it says I should. Also does anyone have some tips on learning c++. Thanks. (below is the code im trying to compile)
// Listing 2.2 using std::cout
#include <iostream>
int main()
{
std::cout << "Hello there.\n";
std::cout << "Here is 5: " << 5 << "\n";
std::cout << "The manipulator std::end1 ";
std::cout << "writes a new line to the screen.";
std::cout << std::end1;
std::cout << "here is a very big number:\t" << 70000;
std::cout << std::end1;
std::cout << "Here is the sum of 8 and 5:\t" << (8+5) << end;
std::cout << 8+5 << std::end1;
std::cout << "Here's a fraction:\t\t";
std::cout << (float) 5/8 << std::end1;
std::cout << "And a very very big number:\t";
std::cout << (double) 7000 * 7000 << std::end1;
std::cout << "Dont forget to replace Jesse Liberty";
std::cout << "With your name...\n";
std::cout << "Aaron McBride is a C++ programmer!\n";
return 0;
}