Export (0) Print
Expand All
Expand Minimize

Compiler Error C3286

Error Message

'specifier': an iteration variable cannot have any storage-class specifiers

See Storage-Class Specifiers for more information.

See for each, in for more information.

Example

The following sample generates C3286.

// C3286.cpp
// compile with: /clr
int main() {
   array<int> ^p = { 1, 2, 3 };
   for each (static int i in p) {}   // C3286 
   for each (int j in p) {}   // OK
}

Community Additions

ADD
Show:
© 2014 Microsoft