Compiler Error C2109
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C2109

Error Message

subscript requires array or pointer type

The subscript was used on a variable that was not an array.

The following sample generates C2109:

// C2109.cpp
int main() {
   int a, b[10] = {0};
   a[0] = 1;   // C2109
   b[0] = 1;   // OK
© 2016 Microsoft