Linked Questions

126 votes
15 answers
136k views

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 ' ...
paoloricardo's user avatar
  • 1,383
146 votes
9 answers
127k views

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 ...
Baruch's user avatar
  • 22k
72 votes
5 answers
97k views

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 ...
OVERTONE's user avatar
  • 12.4k
64 votes
2 answers
314k views

What is the use of using namespace std? I'd like to see explanation in Layman terms.
Jarvis's user avatar
  • 647
23 votes
7 answers
18k views

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 ...
user avatar
16 votes
5 answers
15k views

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:...
Devesh Lohumi's user avatar
5 votes
5 answers
49k views

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++ ...
jlcv's user avatar
  • 1,828
4 votes
4 answers
4k views

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 ...
limp_chimp's user avatar
  • 15.6k
10 votes
2 answers
7k views

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 ...
Meysam's user avatar
  • 18.3k
2 votes
2 answers
4k views

Two ways to use the using declaration are using std::string; using std::vector; or using namespace std; which way is better?
Sanfer's user avatar
  • 414
6 votes
3 answers
3k views

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:...
Sireiz's user avatar
  • 393
1 vote
1 answer
7k views

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 ...
vlad's user avatar
  • 343
2 votes
2 answers
1k views

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: ...
Tony The Lion's user avatar
4 votes
4 answers
3k views

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 ...
user3857017's user avatar
-2 votes
1 answer
11k views

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++) { ...
zev's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
238