Const Parameters & In Line Functions 04/15/11
Next Time Quiz, Monday, 04/18/11 Over 5.2 and 5.3 void functions pass-by-reference Read 7.1 about arrays
Pass Objects By-reference More efficient Opens possibility of changing Object const in front to protect point1.cpp void reflection_of(const Point &C, double v_axis);
Inline Function Can give the function definition within the class definition. Point class on next slide has in-line functions. One of them is the default constructor.
Constant Function Member function that promises not to change any of the object's data members. Add const after prototype double get_degrees( ) const; tconstr.cpp Should rise() or input_T() be const?
Circle Example Write a class declaration for a class called Circle with a private data member called radius. Write an accessor function for the radius. Write a constructor to initialize the radius and a default constructor. Write a member function, findArea(), to find the area of the Circle.
Design the Class Attributes? Behaviors?
Next Time Read 6.3 & 6.4 friend functions and overloaded operators