this is some of my code, could you work out how i am suppose to do this?
/*from main.cpp*/
student.read(cin);
student.print(cout) << endl;
-----------------------------
/*from student.cpp*/
const char * Student::getStudents() const{
string tmp;
tmp = getStudentName();
tmp += ": ";
tmp += getStudentID();
return (const char *) tmp.c_str();
}
ostream& Student::print(ostream& stream = cout) const {
stream << getStudents() << endl;
return stream;
}
istream& Student::read(istream& stream) const {
/*What goes here? any help?*/
return stream;
}
---------------------------------------------------
im not sure how to write the read function. Could anyone give me a hand?
I would like the read function to read in the student's details (the Student's Name, and ID) and then call the function getStudents();
thanks