0
Is it necessary to use std::cout or just cout
4 Respuestas
+ 3
If you declare the namespace std
Then just write cout
else you have to declare std::cout for print
Though we use cout most of the time with declaring namespace ,using of std::cout is a good practise.
You can see this article:
https://www.geeksforgeeks.org/using-namespace-std-considered-bad-practice/
+ 7
Be prepared to go down the rabbit hole on why (or why isn't) "using namespace std;" a bad practice, if that is what you are asking. Otherwise, it is as 😭😥 has answered.
https://www.sololearn.com/Discuss/294730/?ref=app
https://www.sololearn.com/Discuss/392399/?ref=app
+ 6
Once define using namespace std ; in beginning then you dont need to write std again and again with cin and cout
+ 5
See this code how i defined
https://code.sololearn.com/c4KinIeDq7ck/?ref=app