chapter  2
42 Pages

C++ and Object-Oriented Programming

This chapter explains the basic concepts of the object-oriented approach and provides the necessary knowledge for students to meet the challenges of object-oriented analysis (OOA). The characteristics of the object-oriented approach are described with examples. These examples are written in C+ +. To help students to understand these simple examples, it is essential to understand a little about C language before we learn C++. There are several reasons of doing so. First, C++ was migrated from C. In fact, C and C++ share many fundamental syntax features. When we learn C, we are in fact learning C++ as well. As C language has been a commonly used language, it is believed that the benefi t of knowing C language would be far beyond what we initially desired. Second, we will study and compare two programming methodologies: structured programming (or function-oriented programming) and OOP. C is a typical structured programming language, whereas C++ is a typical OOP language. To provide a comparative view of the two programming methodologies, this chapter introduces the two sister languages. You will learn that the internal structure of operations within those classes created by C++ is often best built using the traditional structured programming techniques.