Why we can't use endl when we use std::cout enstand of cout ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why we can't use endl when we use std::cout enstand of cout ?

9th Mar 2019, 2:08 PM
Noordeen Hasn
Noordeen Hasn - avatar
2 Answers
+ 3
Actually Dlite , one can only omit the "std::" with the statement: using namespace std; and also using the include statement with or without the using statement.
9th Mar 2019, 3:46 PM
Maxwell Anderson
Maxwell Anderson - avatar
+ 2
std::endl, std::cout In case you include the preprocessing directive #include <iostream>, then you can simply use. cout, endl without prepending "std::"
9th Mar 2019, 2:27 PM
Dlite
Dlite - avatar