Sams Teach Yourself C++ in 21 Days

(singke) #1

DAY 18


WEEK 3

Creating and Using


Namespaces


Namespaces can be used to help you organize your classes. More importantly,
namespaces help programmers avoid name clashes when using more than one
library.
Today, you will learn


  • How functions and classes are resolved by name

  • How to create a namespace

  • How to use a namespace

  • How to use the standard namespace std


Getting Started ....................................................................................................


Name conflicts have been a source of aggravation to both C and C++ develop-
ers. A name clash happens when a duplicate name with matching scope is
found in two parts of your program. The most common occurrence can be
Free download pdf