I lost my notes when my professor was going over how to "chain" your class by returning a reference to the class somehow (laptop was stolen). Now I can't remember exactly how to return this in the function definition. Any help? See attached shorthand code.
Code:
//student.h file> setName function prototype
class Student{
public:
....
Student & setName( const string newName );
...
private:
string name;
...
}; // class Student
//student.cpp file> setName function definition
Student & Student::setName( const string newName ){
name = newName;
return ???;
};
Thanks in advance!