Problems with input/output file program.
Code:
cisDegree >> student_Identifier >> last_Name >> first_Name >> middle_Initial >> grade_Point_Average >> major_Char;
while (!cisDegree.eof())
{
//Nested decision structure to write the information to the appropriate file according to their major.
if (major_Char == 'A')
appMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
else if (major_Char == 'N')
netMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
else if (major_Char == 'P')
progMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
else if (major_Char == 'W')
webMajors << student_Identifier << " " << last_Name << " " << first_Name << " " << middle_Initial << " " << grade_Point_Average << " ";
cisDegree >> student_Identifier >> last_Name >> first_Name >> middle_Initial >> grade_Point_Average >> major_Char;
}
I have all the variables declared, and all the files open, but for everywhere there is a >>, << before last_Name it says error 2679. im supposed to read the 6 variables from the input file and send them based on char to separate output files. Any idea on how to fix this error?
Re: Problems with input/output file program.
Error c2679 means "no operator found which takes a right-hand operand of type 'type' (or there is no acceptable conversion)".
See http://msdn.microsoft.com/en-us/library/h1925w4w.aspx
Of what type is last_Name? You haven't provided the definitions. It would be better if you showed the whole program so that we can better advise.
Re: Problems with input/output file program.
Nothing to do with your question, but those aren't nested if statements.