Objectives
In this chapter you’ll:
• Define a class and use it to create an object.
• Implement a class’s behaviors as member functions.
• Implement a class’s attributes as data members.
• Call a member function of an object to perform a task.
• Learn the differences between data members of a class and local variables of a function.
• Use a constructor to initialize an object’s data when the object is created.
• Engineer a class to separate its interface from its implementation and encourage reuse.
• Use objects of class string
.
3.2 Defining a Class with a Member Function
3.3 Defining a Member Function with a Parameter
3.4 Data Members, set Member Functions and get Member Functions
3.5 Initializing Objects with Constructors
3.6 Placing a Class in a Separate File for Reusability
3.7 Separating Interface from Implementation
3.8 Validating Data with set Functions
18.227.46.69