12. Namespaces & Modularization
In this chapter we primarily discuss two quite simple and somewhat related concepts. The first is modularization: breaking an application down into subparts. This is accomplished by dividing one’s code into several files, which can then be reassembled when the application is compiled.
The second subject is namespaces, which is kind of new to C++ (and not found in C at all). The more you program and the more complex your applications become, the more necessary namespaces are. You’ve actually been dealing with namespaces without even knowing it throughout the entire book, so it’s about time you formally learn about that subject.
Included in this mix of subjects is another explanation of variable scope: where variables ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access