Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The goal of introducing classes in C++ is to render support to the practices of object-oriented programming and eliminate the drawbacks caused by using smaller units of modularity: functions.
The first primary goal of the class construct is to bind together data and operations into one syntactical unit, and to indicate that these coding elements belong together. The next primary goal is to eliminate name conflicts so that data and functions in different classes can use the same names without clashes. The third important goal of the class construct is to allow the server designer to control access to class elements from the outside (from the client code). The fourth goal is to support encapsulation, information hiding, pushing responsibilities from client code down to the server code, creating separate areas of concern and eliminating overlapping knowledge and coordination among programmers working on different parts of the program.