• Create Account

### #ActualMatt-D

Posted 15 July 2012 - 03:46 PM

Yeah, but main problem is that internet is powerfull source of knowledge. I can find almost everything that i want and i need, sure. But how beginner can separate garbage from diamond? One website for example say to always use

using namespace std;


using std::cout;
using std::cin;

that i prefer. Which one is correct?

I know that i can learn from web, but i dont want to losse my time for future re-learning things that was not correct.

The ones that use the using directive (e.g., "using namespace std;") instead of using declaration (e.g., "using std::cout;") might come from a legacy codebase (ported from C, pre-standard C++ before 1998, etc.). Generally, this is not a good practice due to namespace pollution. See: http://www.gotw.ca/p..._namespaces.htm

### #1Matt-D

Posted 15 July 2012 - 03:46 PM

Yeah, but main problem is that internet is powerfull source of knowledge. I can find almost everything that i want and i need, sure. But how beginner can separate garbage from diamond? One website for example say to always use

using namespace std;


using std::cout;