What the heck is going on here??
while (getline(inStream, line))
while (inStream >> Student.getId() >> Student.FNAME >> Student.MINIT >> Student.LNAME >> Student.GENDER >> Student.UNITS >> Student.getGpa())
while (Student.getId() != id)
outStream << line << endl;
This is what I have right now. It shouldn't be a problem, but for some reason I am getting an error trying to >> Student.getGpa()
Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'double' (or there is no acceptable conversion) c:location 130 1 Project 5
I will post more code if needed, but... I just don't know. I have a TON of code so I would rather not if I don't have to. Do I need to #include something...? I'm so confused..
It seems like it's saying I can't use the >> operator on doubles...? I don't get it. I've done that before so why is it a problem this time..
Probably because the overload you're looking for uses double&, not double. Does getGPA() return a reference or a copy?
Any function whose parameters are references will not work on temporary values.
cin >> 13.4; //Remember that this doesn't work.
I suspect you will have the same issue with getID().
Topic archived. No new replies allowed.