So, as you guys probably know, I recently found out something about the standard namespace (aka "using namespace std;"). I realized that using the standard namespace can actually be bad practice because it can be referred to as "global namespace pollution". This means that you may run into problems whenever you have multiple namespaces that contain an identical function name with signature, so it would be kind of obscure for the compiler to be able to choose which one it would call, but this can be bypassed by designating the namespace with your function call, like this:
Or, if you don't want to type 'std::', then you can just do something like this:
Some of you probably already knew this and these "problems" are pretty much an uncommon thing to come across in the first place, but I just thought I would share it with you guys anyways. Peace. :P
Code:
std::cout
Or, if you don't want to type 'std::', then you can just do something like this:
Code:
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
cout << "Hello, world!";
return 0;
}
Some of you probably already knew this and these "problems" are pretty much an uncommon thing to come across in the first place, but I just thought I would share it with you guys anyways. Peace. :P