+ 2

Do we have to use using namespace std if we have written end1 in the code?

31st Aug 2018, 2:50 PM
Samiksha Santosh Dhumal
5 odpowiedzi
+ 3
yes if you want to use it without using namespace std , std::cout<<"Hello"<<std::endl; or just use \n instead std::cout<<"Hello\n";
31st Aug 2018, 3:11 PM
Osama Mohamed
+ 3
Osama Samir [not to distract, this is just trivia] endl is a stream manipulator* and also flushes the output buffer. \n is just a replaced special character and does not flush. * http://www.cplusplus.com/reference/iostream/manipulators * http://www.cplusplus.com/reference/ostream/endl/
31st Aug 2018, 4:33 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
Thanks Kirk Schafer that is a new information to me
31st Aug 2018, 4:40 PM
Osama Mohamed
+ 1
I assume that you're taking about endl (end line ) not end1( end one ) ! yes , you can do without It just make new line Edit: look at Kirk Schafer comment
31st Aug 2018, 3:22 PM
Osama Mohamed
0
Is there any need to write end1? without that also we can execute the program..
31st Aug 2018, 3:17 PM
Samiksha Santosh Dhumal