Let's say I create a class object, with certain private variables and public accessor and mutator public functions within the class to access/change those variables.
Now let's say I create an instance of that class object, let's call it A, within the main functions. And in main(), I call functions declared outside of main(), to which I pass in A, the instance the class object. What I want to do is, in these outside functions, use the already implemented public mutator functions to, outside of main(), change the values in the existing private variables of instance A. With my code, I've been trying to do that, by let's say passing in like so:
randomFunction(objectInstance);
And within the random function defined outside of main(), I've tried changing the values within the private variable like so:
void randomFunction(classObject objectInstance){
...
objectInstance.changeValue(657428391);
...
}
but the actual value isn't updated in main(). Is there some pointer magic I can do with class object instances?