Namespaces

Namespaces

Question:
To use or , I need to use “using namespace std;”. What is the meaning of it? When I have multiple .h and .cpp files, where should I put it: inside .h file or .cpp file? Or both wherever I have or ?

Answer:
Remember that almost all the classes, functions, constants, typdefs and objects of the Standard Library are not declared in the global namespace anymore, but rather they are declared in namespace std. Therefore, when you refer to these identifiers, you have to use their qualified names or use an appropriate using-declaration or using-directive. The “using namespace std;” statement is called a using-directive. It instructs the compiler to resolve all references to identifiers in the program that don’t have qualified names as if they did appear in their qualified form: std::xxx, where xxx is the identifier name as it appears in the program. For example, the unqualified names string and cin are construed as std::string and std::cin, respectively. You can reads more about namespaces here: www.informit.com/matter/art0000012/

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of