Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello everybody,

just was working on this code that i need to compile but it gives error messages saying 'endl' : undeclared identifier

here is my code

#include <iostream>
int main ()
{
std::cout << "Hello there. \n";
std::cout << "here is 5: " << 5 <<"\n";
std::cout << "The manipulator endl writes a new line to the screen.";
std::cout <<
endl;
std::cout <<"Here is a very big number :\t" << 70000 << endl;
std::cout <<"Here is the sum of 8 and 5:\t" << 8+5 << endl;
std::cout <<"Here is a fraction :\t\t" << (float) 5/8 << endl;
std::cout <<"And a very very big number :\t";
std::cout << (double) 7000*7000 <<
endl;
std::cout <<"dont forget to replace Francois Bitas with your name ..\n";
getchar ();
return 0;
}
Posted

1 solution

Try adding:
C++
using namespace std;

Or try:
C++
std::cout << std::endl;

I'm pretty sure endl is in the std namespace, so you either have to fully qualify it or import the namespace.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900