I am new so please tell me what had I done wrong. I am doing some tutorials from a book and this is the code
// 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 << "Write a few 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 a sum of 8 and 5:\t";
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 big number:\t";
std::cout << (double) 7000 * 7000 << std::end1;
std::cout << "Don't forgot to replace the Jeese Liberty";
std::cout << "With your name...\n";
std::cout << "Kwokho is a C++ programmer!\n";
return 0;
}
And it give me errors like
UsingCout.cpp: In function 'int main()':
UsingCout.cpp:9: error: 'end1' is not a member of 'std'
UsingCout.cpp:11: error: 'end1' is not a member of 'std'
UsingCout.cpp:12: error: expected `;' before string constant
UsingCout.cpp:13: error: expected primary-expression before 'end1'
UsingCout.cpp:13: error: expected `;' before 'end1'
UsingCout.cpp:15: error: 'end1' is not a member of 'std'
UsingCout.cpp:17: error: 'end1' is not a member of 'std'
Please tell me what had i done wrong.
thanks
// 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 << "Write a few 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 a sum of 8 and 5:\t";
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 big number:\t";
std::cout << (double) 7000 * 7000 << std::end1;
std::cout << "Don't forgot to replace the Jeese Liberty";
std::cout << "With your name...\n";
std::cout << "Kwokho is a C++ programmer!\n";
return 0;
}
And it give me errors like
UsingCout.cpp: In function 'int main()':
UsingCout.cpp:9: error: 'end1' is not a member of 'std'
UsingCout.cpp:11: error: 'end1' is not a member of 'std'
UsingCout.cpp:12: error: expected `;' before string constant
UsingCout.cpp:13: error: expected primary-expression before 'end1'
UsingCout.cpp:13: error: expected `;' before 'end1'
UsingCout.cpp:15: error: 'end1' is not a member of 'std'
UsingCout.cpp:17: error: 'end1' is not a member of 'std'
Please tell me what had i done wrong.
thanks