Home > Software engineering >  MFC emergency!!!!!!
MFC emergency!!!!!!

Time:09-28

MFC use ifstream problems
The error C2678: binary '& gt;> ': no operator defined which takes a left - hand operand of type' class cost '(or there is no acceptable conversion)
Problems appeared in the line
F1 & gt;> CTRLC [I] bianhao> CTRLC [I] company> CTRLC [I] leixing> CTRLC [I] zaikeliang;
Use ofstream & lt; We have a problem?


# include "fstream. H"
# include "iostream. H"


Ifstream F1 (" D: \ \ datebase \ \ messagebase TXT ");
for(i=0; I<20; I++)
{


F1 & gt;> CTRLC [I] bianhao> CTRLC [I] company> CTRLC [I] leixing> CTRLC [I] zaikeliang;

}//read from the file array
F1. The close ();

CodePudding user response:

serialization: define the serializable class
  • Related