// StudentInserter - #include #include #include // Student - your typical beer swilling undergraduate class Student { friend ostream& operator<<(ostream& out, Student& d); public: Student(char* pszFName, char* pszLName, int nSSNum) { strncpy(szFName, pszFName, 20); strncpy(szLName, pszLName, 20); this->nSSNum = nSSNum; } protected: char szLName[20]; char szFName[20]; int nSSNum; }; // inserter - output a string description // (this version handles the case of cents // less than 10) ostream& operator<<(ostream& out, Student& s) { out << s.szLName << ", " << s.szFName << "(" << s.nSSNum << ")"; return out; } int main(int nArgc, char* pszArgs[]) { Student student("Kinsey", "Lee", 1234); cout << "My friend is " << student << "\n"; return 0; }