Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 773 Bytes

compiler-error-c3286.md

File metadata and controls

27 lines (22 loc) · 773 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3286
Compiler Error C3286
11/04/2016
C3286
C3286
554328c8-cf44-4f7d-a8d2-def74d28ecdd

Compiler Error C3286

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

A storage class can't be specified on an iteration variable. For more information, see Storage classes (C++) and for each, in.

Example

The following sample generates C3286, and also shows correct usage.

// 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
}