4.3. C-Style Character Strings
Dynamic Arrays of const Objects
If we create an array of const objects of built-in type on the free store, we must initialize that array: The elements are const, there is no way to assign values to the elements. The only way to initialize the elements is to value-initialize the array:
// error: uninitialized const array
const int *pci_bad = new const int;
// ok: value-initialized const array
const int *pci_ok = new const int();
It is possible to have a const array of elements of a class type that provides a default constructor:
// ok: array of 100 empty strings
const string *pcs = new const string;
In this case, the default constructor is used to initialize the elements of the array.
Of course, once the elements are created, they may not be changedwhich means that such arrays usually are not very useful.