0
std:: vs using namespace std
I heard that writing "using namespace std" is a bad style. But is it normal to add "std: :" to every endl, sin and cout?
1 ответ
+ 1
Hi, using std:: is considered good style as it makes clear what function, class or instance you mean: the ones in std. If you have functions, classes etc with the same name but in different namespaces you *need* to do it to be unambiguous.
Being explicit and portable is exactly why you write namespace specifiers.