Suppose you have a class Type called ClassType and AnotherClass.
Code: Select all
class AnotherClass
{
public:
//functions
private:
//members
};
class ClassType
{
public:
/// some functions
private:
AnotherClass* classes;
};
Code: Select all
ClassType::ClassType
{
Another* classes = new AnotherClass[10];
}
Code: Select all
ClassType::operator=(ClassType& something)
{
classes = FunctionToCopyArray(something);
}
Code: Select all
ClassType dogs = ClassType(initialize parameters;
ClassType Kittens = dogs;
Code: Select all
ClassType* array = new ClassType[10];
array[1] = dogs;
In my case the array[1] is a private member of a third class and the function doing the equalization is a public function of that third class.