void Employee::store_data(string filename) {
fstream file;
file.open(filename,ios::app | ios::binary);
if (file) {
file.write((char*)&this,sizeof(this));
file.close();
}
else cout<<"\n Error in Opening the file!";
}
this is what i tried. I want to store the current object of employee class to a file in binary mode. but i get this this
error: lvalue required as unary '&' operand
file.write((char*)&this,sizeof(this));