Creation of Dynamic Array of Dynamic Objects in C++
问题 I know how to create a array of dynamic objects. For example, the class name is Stock. Stock *stockArray[4]; for(int i = 0 ; i < 4;i++) { stockArray[i] = new Stock(); } How do you change this to dynamic array of dynamic objects? What I tried: Stock stockArrayPointer = new Stock stock[4]; It doesn't work and the error is "The value of Stock** cannot be used to initalize an entity of type Stock. Second question is after the creation of dynamic array of dynamic objects, what is the syntax to