Z
zahy[dot]bnaya[At]gmail[dot]com
Hi all,
Since I am always confusing this, I want to know once and for all what
is the right way of doing this.
I've noticed that some programs use:
std::cout<< "yadayada"<<endl;
[which I'll call it alternative 1]
while some others use:
cout<< "yadayada"<<endl;
usually they have:
using namespace std;
somewhere.
[which I'll call it alternative 2]
now, I can understand that both has the same effect since the "using
namespace" is somehow equivelant to std:: before the cout.
I am more of an alternative 2 person but every now and then it does not
work untill I explicitly type the std:: before the statement.
what are the pros and cons of using each of the alternatives?
what should I use?
Thanks.
Since I am always confusing this, I want to know once and for all what
is the right way of doing this.
I've noticed that some programs use:
std::cout<< "yadayada"<<endl;
[which I'll call it alternative 1]
while some others use:
cout<< "yadayada"<<endl;
usually they have:
using namespace std;
somewhere.
[which I'll call it alternative 2]
now, I can understand that both has the same effect since the "using
namespace" is somehow equivelant to std:: before the cout.
I am more of an alternative 2 person but every now and then it does not
work untill I explicitly type the std:: before the statement.
what are the pros and cons of using each of the alternatives?
what should I use?
Thanks.