52 C++ Programming
were sufficient. When I reached Navi Mumbai, I noticed that driving was easier because
it is planned using a systematic technique. How is this conversation related to C++ pro-
gramming? You can treat Mumbai planning as writing C programs using the structured
programming approach, while Navi Mumbai is like C++ programming using the object-
oriented approach.
Object-oriented programming is done by using objects of a class. Class encapsulates
data and functions into a single unit. It discourages use of global variables or global
functions, i.e., in the aforementioned program, main function creates object of a
particular class. For example, CuboidMetal and SphericalMetal access the functions
associated with them. The main function ...