If you write A * a = new A(), the default constructor of the class is called Aand dynamically allocates memory for one object of the class A, and the address of the allocated memory is assigned to the pointer A. Thus, the Aclass object indicates A, not an array. However, if you want an array of Aobjects dynamically, then you will need to write something like this A * a = new A[10]. This will allocate memory from 10 objects A. And you can write a[0], a[1], ... a[9]to access array objects.
, , []? [], , A - , a[1], A A, , . ( , , , ). [] , . . :
A * a = new A;
cout << a->operator[](0) << endl;
A a->operator[](0). . , ?
A * a = new A[6];
cout << a[0][0] << endl;
. a[0]
EDIT: A. jschultz410, .