How do I achieve the dynamic equivalent of this static array initialisation:
char c[2] = {}; // Sets all members to \'\\0\';
In other word
Since c++11 we could use list initialization:
char* c = new char[length]{};
For an aggregate type, then aggregate initialization will be performed, which has the same effect like char c[2] = {};.
char c[2] = {};