About 17,400,000 results
Open links in new tab
  1. c++ - What's the problem with "using namespace std ... - Stack Overflow

    Dec 16, 2014 · Don't forget you can do: "using std::cout;" which means you don't have to type std::cout, but don't bring in the entire std namespace at the same time. It is particularly bad to …

  2. Why "using namespace std" is considered bad practice

    Mar 29, 2024 · The statement using namespace std is generally considered bad practice. The alternative to this statement is to specify the namespace to which the identifier belongs using …

  3. c++ - I would like to remove using namespace std from this …

    Apr 10, 2011 · Given the frequency that you use cout, you might want to replace using namespace std; with using std::cout;. As Xeo says, you should search-and-replace endl with …

  4. C++ Without Using Namespace Std: Best Practices in ... - Code …

    Jan 3, 2024 · Throughout the program, std’s utilities that don’t conflict with custom implementations (such as std::out_of_range and std::cout) are used directly without ‘using …

  5. Using Namespace std;" in C++: Why It's Considered Bad Practice

    Sep 2, 2023 · When you write using namespace std;, you're essentially telling the compiler to consider all the names in the std namespace as if they're in the global namespace. This …

  6. namespace - Use `using` in C++ or avoid it? - Software …

    Jun 13, 2019 · As VJovic indicates, do not use using in a header file. using in a header file affects the current compilation unit (the .cpp file) in ways that the source file may not be expecting. …

  7. Why You Should Avoid Using namespace std in C++: Best

    Jul 19, 2024 · While using namespace std; might save a few keystrokes, the potential pitfalls make it a practice best avoided. By being mindful of namespace management, you can write …

  8. Best way to code without using namespace std? : r/cpp_questions - Reddit

    Sep 18, 2021 · For std specifically you should explicitly qualify it to flag that it is not an internal type. For other namespaces, using specific types from it is a good idea if you are using said …

  9. [C++] How to avoid using "namespace std" - Reddit

    Sep 4, 2021 · For something like std::filesystem it can get a bit verbose sometimes, even for me. A common compromise in this situation, that even cppreference.com use in many of their …

  10. Better Alternatives for 'using namespace std' in C++ - The …

    Why you should avoid using namespace std in the global scope? When ‘using namespace std’ is added to your code, the compiler will look for identifiers in the std:: namespace if it can’t find …

Refresh