Since the answer to the question itself was not given (that "the expression must have a constant value" ), I will explain ...
The compiler has not yet begun to understand what you select, what type, and how you can assign it later - your type is incorrectly declared, but this is the second question. While he is looking at new char[RowCount][ColCount] . And since the design
new char[A][B]
quite workable in C ++ (see, for example, http://ideone.com/bJeaHF , you just need to understand what it does and what restrictions are placed on it), then it starts to deal with it. What does she do? It allocates memory for A arrays of size B , except that size B must be a compile-time constant. Then it can be rewritten in a familiar and more understandable form:
using str = char[B]; new str[A];
It is a constant restriction among arrays :) Recall, for example, that a two-dimensional array can be passed to a function — but only the second dimension should be a compile-time constant. So here. But! Your constants, although described as const , are runtime constants - they cannot change after initialization, but they are unknown during compilation - because of the calculation of Height(Root) - is this not a constexpr - a function of the constexpr ? :)
So they point to this sad fact that at compile time the value of ColCount unknown ...
std::vector? - AnT