H
hits
Should the following passing of private variable refrence work?
( Relates to the power of references to access private data variable).
class B;
class A
{
private:
int var;
void func_a()
{
B b;
b.func_b(var);
}
};
class B
{
func_b(int &a)
{
a=a+1;
}
};
( Relates to the power of references to access private data variable).
class B;
class A
{
private:
int var;
void func_a()
{
B b;
b.func_b(var);
}
};
class B
{
func_b(int &a)
{
a=a+1;
}
};