Compiler Error C2466

cannot allocate an array of constant size 0

An array of constant size 0 was allocated or declared.

The constant expression used to allocate or declare an array must be an integral type greater than zero.

An array declaration with a zero subscript is legal only for a class, structure, or union member, and when the Microsoft extensions (/Ze) are enabled.

The following examples cause this error:

int *p = new X[0];        // error
C *aC = new [int_var] C;  // error
int[0]                    // error