C++ instantiating a class within a method, then altering member variables from a different method?
- by Dominic Bou-Samra
Say I have a method, and within that method it instantiates a Person class:
void methodA()
{
Person personObject;
}
How would I access that object's methods from within another method? I.e. something like:
void methodB()
{
personObject.someMethod();
}
I realise it's a painfully nooby question :P