Case 1:
#include <iostream>
int main()
{
std::cout<<"Hello World"<<endl;
return 0;
}
Compiler give an error because endl
need namespace std
like std::endl
.
case 2:
#include <iostream>
int main()
{
endl(std::cout);
return 0;
}
But, In second case without namespace std
, endl
working fine. Demo.
Why does endl
working fine without namespace std
?