I'm getting the following error when trying to compile my code:
Not sure what it means, but it didn't start until after I added the "read_file" function (btw I know the function is mostly commented out, I'm still working on it). I think it has something to do with the fact that I am trying to pass a structure (acnt) to a function and is giving me an error for some reason. My code is below (parts have been removed to conserve space, and replaced with "..." but it is still in the same order as the original code).
error C2248: 'std::basic_ios <_Elem,_Traits> ::basic_ios' : cannot access private member declared in class 'std::basic_ios <_Elem,_Traits> '
Code:
struct acnt
{
int number;
name *fname;
name *lname;
float balance;
char *next;
};
.
.
.
void read_file(fstream, acnt);
.
.
.
void read_file(fstream in_file, acnt records)
{
while (! in_file.eof() ) //read until end of file
{
//in_file >> records.number;
//in_file >> records.fname;
//in_file >> records.lname;
//in_file >> records.balance;
cout<<"file read okay :)" <<endl;
}
}
Comment