Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 750 Bytes

compiler-error-c2466.md

File metadata and controls

23 lines (19 loc) · 750 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2466
Compiler Error C2466
11/04/2016
C2466
C2466
75b251d1-7d0b-4a86-afca-26adedf74486

Compiler Error C2466

cannot allocate an array of constant size 0

An array is allocated or declared with size zero. The constant expression for the array size must be an integer greater than zero. An array declaration with a zero subscript is legal only for a class, structure, or union member and only with Microsoft extensions (/Ze).

The following sample generates C2466:

// C2466.cpp
// compile with: /c
int i[0];   // C2466
int j[1];   // OK
char *p;