#include <iostream>
class B;
class A{
int a;
public:
friend void B::frndA();
};
class B{
int b;
public:
void frndA();
};
void B::frndA(){
A obj;
std::cout << "A.a = " << obj.a << std::endl;
}
int main() {
return 0;
}
When I am trying to compile this code some error occurred. Can anyone explain what are the problems in this code