I have a class that contains a dynamically allocated array, say
class A { int* myArray; A() { myArray = 0; } A(int size) {
Use array or common container for objects only if they have default and copy constructors.
Store pointers otherwise (or smart pointers, but may meet some issues in this case).
PS: Always define own default and copy constructors otherwise auto-generated will be used