Linked Questions
3,570 questions linked to/from What's the problem with "using namespace std;"?
126 votes
15 answers
136k views
Using std Namespace [duplicate]
There seem to be different views on using 'using' with respect to the std namespace. Some say use ' using namespace std', other say don't but rather prefix std functions that are to be used with ' ...
146 votes
9 answers
127k views
"using namespace" in c++ headers [duplicate]
In all our c++ courses, all the teachers always put using namespace std; right after the #includes in their .h files. This seems to me to be dangerous since then by including that header in another ...
72 votes
5 answers
97k views
std::string vs string in c++ [duplicate]
Possible Duplicates: Why is 'using namespace std;' considered a bad practice in C++? Using std Namespace I've been hovering around a bunch of different forums and I seem to see this pop up every time ...
64 votes
2 answers
314k views
What is the use of "using namespace std"? [duplicate]
What is the use of using namespace std? I'd like to see explanation in Layman terms.
23 votes
7 answers
18k views
Is using namespace..like bad? [duplicate]
Possible Duplicate: Why is 'using namespace std;' considered a bad practice in C++? Every time I use using namespace std I always get that "thats a terrible programming habit". Now I'm ...
16 votes
5 answers
15k views
Which is the best way to print to the console in c++? [duplicate]
I have read three ways to print things to the console in c++ from various sources. Using using namespace std; and then using cout (CodeBlocks Standard) Not using the above and using std::cout and std:...
5 votes
5 answers
49k views
C++: Questions about using namespace std and cout [duplicate]
Why do I need to type in using namespace std; in order to be able to use cout and endl? Also what are these called; is cout a function? Is there cout in C? I heard it was implemented in C++ ...
4 votes
4 answers
4k views
C++ "using std::<type>" vs calling std::<type> every time [duplicate]
Possible Duplicate: Using std Namespace Why is 'using namespace std;' considered a bad practice in C++? Let's say I'm using #include <iostream> in C++ and I'm making a print ...
10 votes
2 answers
7k views
How to avoid shared_ptr ambiguity? (stl vs boost) [duplicate]
Possible Duplicate: Why is ‘using namespace std;’ considered a bad practice in C++? I've used stl's shared_ptr many places in my code and I have used the following using statement anywhere that I ...
2 votes
2 answers
4k views
using std::<type> v.s. using std namespace [duplicate]
Two ways to use the using declaration are using std::string; using std::vector; or using namespace std; which way is better?
6 votes
3 answers
3k views
C++ Namespaces and header files [duplicate]
I have seen codes with using namespace std;. Does it mean that if we use this then we don't have to include header files in the code or if we don't use namespaces, does it mean that we have to use std:...
1 vote
1 answer
7k views
Error using Qt during build: C2872: 'byte': ambiguous symbol [duplicate]
I have Qt Creator with compiler Desktop x86-windows-msvc2019-pe-64bit, Qt Creator 4.11.1 ("based on Qt 5.14.1 MSVC2017, 32 bit), built Feb 5 2020, Boost library 1.72 and also Microsoft Visual Studio ...
2 votes
2 answers
1k views
Why shouldn't I put "using namespace std" in a header? [duplicate]
Someone once hinted that doing this in a header file is not advised: using namespace std; Why is it not advised? Could it cause linker errors like this: (linewrapped for convenience) error LNK2005: ...
4 votes
4 answers
3k views
Using namespace std vs other alternatives [duplicate]
using namespace std; So far in my computer science courses, this is all we have been told to do. Not only that, but it's all that we have been allowed to do, otherwise we get penalized on our code. I ...
-2 votes
1 answer
11k views
why is it giving an error saying " reference to max is ambiguous" in line 12 "if(k>=max)"? [duplicate]
here is my function,max is global; #include<iostream> using namespace std; int max = 0; int q = 0; int func(int a[], int n) { int k = 1; for(int j = q + 1; j < n; j++) { ...