I'm trying to let one particular function of class B to read a private variable "number" in a class A. Compilation of code below gives me plenty of errors, what I did wrong, what should I change?
This is a little tricky, as each class A and B depends on the other. First, the friend function should be declared as public, and use the scope resolution B:: instead of B.