Pages

July 26, 2010

Revew OOP244 - Operator +

 Student operator+(const Student &student, char grade) {
Student modified = student;
modified += grade; // calls += operator
return modified;
}

Student operator+(char grade, const Student &student) {
return student + grade; // calls operator+(const
// Student&, char)
}


No comments:

Post a Comment