Overloading Operator + Array
I'm suppost to display my entries by overloading the "<<" operator using friend functions. I can currently do:
and everything works. However, all my entries are stored in an array(actually two but i will only refer to one since they are basically the same).
So i was outputting the entries like:
however, i am suppost to make use of the overloaded "<<" operator to output the entries, and I am not sure how to do this.
These are my overloaded friend functions:
I'm not sure how to output the entries in the array using the overloaded operator. I'm thinking it would be something like:
friend ostream &operator<< (ostream &, Student &);
ostream &operator<<(ostream &output, Student &person)
output<<"First Name: "<<person.getFirst_Name()<<endl;
output<<"Last Name: "<<person.getLast_Name()<<endl;
output<<"Phone Number: "<<person.getPhone_Number()<<endl;
I'm not sure what to do.