Thanks for the quick and clear answer to my previous question. The next question is this: the proposed solution to the problem (if I understood everything correctly) implies that the user must know the structure of all the pieces of hardware that he needs to describe and, when initializing the assembly, must immediately bring in all the components. This is often unrealistic. That is, it is necessary to allow the user to add new elements to the array property after initializing the assembly class. I wrote something similar here, but it doesn’t inspire confidence in me (although compiling it is already good), comment, please, my works
class clPart { //деталь public: int prtHeight; int prtWidth; int prtLength; }; class clUnit { //сборка private: clPart* pPart; int prtCount; public: clUnit() { prtCount=1; pPart = new clPart[prtCount]; } void addPart(clPart*); }; void clUnit::addPart(clPart* Part){ prtCount++; pPart = new clPart[prtCount]; pPart=Part; //вот это мне очень не нравится, мне кажется это ошибка }; Thanks in advance for the constructive comments without the elements of trolling and sending to Straustrup and Schild)