course content

Course Content

Introduction to C++

Namespace 2/2Namespace 2/2

All of our examples have used the std namespace. This is a standard namespace found in the C++ language and helps us use the commands to print text to the screen (cout and endl), just like we used our functions in the last chapter.

cpp

main.cpp

In this case, the entire std namespace is used, and a large number of commands that we don't need are connected.

Note

There are approximately 92 commands in the standard namespace.

But what if we only need a cout and endl command?

cpp

main.cpp

In this case, we include the cout and endl commands at the beginning of our program only once, we don't have to do this again.

cpp

main.cpp

In this case, we will have to use the std:: expression each time to use the cout and endl commands.

Section 1.

Chapter 5