I have two classes:
class CALLDB;
class CALL
{
friend class CALLDB;
public:
string GetStart()const;
private:
string start;
};
And second class:
class CALLDB
{
friend class CALL;
public:
unsigned int Load(istream& fin);
private:
unsigned int numCalls;
};
In the main function, I did this:
int main(){
CALLDB calldata;
cout<<calldata.numCalls;
}
And then it says:
error C2248: 'CALLDB::numCalls': cannot access private member declared in class 'CALLDB'
Why does it happen? Is something wrong with my friend class declaration?