Abstract
A namespace declaration defines a scope, and can therefore be used to prevent name clashes. The namespace feature is required because C++ defines a single global scope namespace outside the scope ofif-else or switch statement blocks, loops, functions and classes. As programs steadily grow in size they correspondingly become more susceptible to name clashes. A large program will consist of numerous function and class library files, and namespaces allow functions and classes to be associated with a scope other than the global file scope. The namespace feature is particularly useful for eliminating name clashes between applications and function and class libraries
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1996 Springer-Verlag London Limited
About this chapter
Cite this chapter
Seed, G.M. (1996). Namespaces. In: An Introduction to Object-Oriented Programming in C++. Springer, London. https://doi.org/10.1007/978-1-4471-3378-0_19
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3378-0_19
Publisher Name: Springer, London
Print ISBN: 978-3-540-76042-9
Online ISBN: 978-1-4471-3378-0
eBook Packages: Springer Book Archive