Re: [Dev-C++] no match for istream & >> {unknown type}
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Bolek V. <vr...@pa...> - 2001-02-20 11:24:18
|
Hi,
the real problem is that name is a method of the Student_info class, not
a data field (see declaration). You have to change your code to
istream& Student_info::read(istream& is)
{
//read and store the student's name and midterm and final exams
grades
is >> n >> midterm >> final;
read_hw(is, homework); //read and store all the stud
homework grades
return is;
}
I think this is what you have wanted. BTW, istream& read_hw(istream& in,
vector<double>& hw) should return a value. Dev-CPP didn't warn me about
it, but C++ Builder did.
--
============================================================
Ing. Boleslav Vrany
Stanice techniku DDM hl. m. Prahy
Pod Juliskou 2a
Praha 6 - Dejvice
16000
Czech Republic
tel. (420 2) 243 10 240
|