I defined two classes class A and class B. They are completely independent.
Now I create c as instance of class B and d as instance of class A. Now I want to define the body of functionOfA that will perform operations on c:
class A {
public:
    functionOfA();
}
class B {
    ...
}
A::functionOFA()
{
    c.functionOfB();
}
main()
{
    A d;
    B c;
    d.functionOfA();
}
but the compiler gives me the following error: c is not declared in this scope
 
     
     
     
     
     
     
    