About 974,000 results
Open links in new tab
  1. What's the problem with "using namespace std;"?

    I have heard using namespace std; is wrong, and that I should use std::cout and std::cin directly instead. Why is this? Does it risk declaring variables that share the same name as something in the...

  2. What is the function of "using namespace std;" in C++?

    The name vector exists within namespace std (as a templated class). In main() when it sees usage of the name vector, the previous using namespace std causes the compiler to look in std for names that …

  3. c++ - Using std Namespace - Stack Overflow

    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 '...

  4. What is the use of "using namespace std"? [duplicate]

    Sep 20, 2013 · E.g. if you add using namespace std; you can write just cout instead of std::cout when calling the operator cout defined in the namespace std. This is somewhat dangerous because …

  5. How do you properly use namespaces in C++? - Stack Overflow

    Sep 3, 2008 · But now I'm working in C++. How do you use namespaces in C++? Do you create a single namespace for the entire application, or do you create namespaces for the major components? If so, …

  6. c++ - Using Namespace std - Stack Overflow

    Oct 13, 2015 · When you type using namespace std, you are taking everything inside of the namespace std and moving it to the global scope, so that you can use the shorter cout instead of the more fully …

  7. c++ - Пространство имен (using namespace std;) - Stack Overflow на …

    Jan 19, 2016 · Неожиданный using namespace std, привнесённый в код заголовочным файлом, может всё поломать. Однако в cpp-файлах я всё время использую using namespace std. И …

  8. Why don't you have to #include<vector>, if you already include 'using ...

    May 23, 2019 · The using namespace std; directive just says "For anything in the std namespace that I know about, you can leave off the std:: prefix". But without the #include <vector> (directly or indirectly …

  9. What requires me to declare "using namespace std;"?

    May 31, 2012 · This question may be a duplicate, but I can't find a good answer. Short and simple, what requires me to declare using namespace std; in C++ programs?

  10. What is "using namespace::std" in C++ - Stack Overflow

    Dec 16, 2021 · It's equivalent to using namespace ::std; and also equivalent to using namespace std;. The :: refers to the global namespace, and std is put in the global namespace indeed.