I have a function which has two parameters, both objects. I change these objects inside the function and I need to see the changes afterwards. But pointers does not work. Any idea?
void foo(apple &a,apple &b)
{
//change a and b
}
main()
{
apple a,b;
foo(a,b);
//a and b are the same as befor calling foo `
}
thanks.
Do you mean changing the methods of the classes you’re passing? You’ll need to use ‘->’ if that’s what you mean.