I copy/paste this console application, which is a banking record keeping system, and I get an error for the ">" operator not having operands; if (infile.read(reinterpret_cast<char*>(this), sizeof(*this)) > 0)
Does it have something to do with types? I read vaguely somewhere about the int
needing to be overloaded or something. Anyways, idk.
Here is part of the code:
void account_query::read_rec()
{
ifstream infile;
infile.open("record.bank", ios::binary);
if (!infile)
{
cout << "Error in Opening! File Not Found!!" << endl;
return;
}
cout << "\n****Data from file****" << endl;
while (!infile.eof())
{
if (infile.read(reinterpret_cast<char*>(this), sizeof(*this)) > 0)
{
show_data();
}
}
infile.close();