หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
for each statement cannot operate on variables of type 'type'
Remarks
The for each statement repeats a group of embedded statements for each element in an array or an object collection.
See for each, in for more information.
Example
The following example generates C3285.
// C3285.cpp
// compile with: /clr
int main() {
for each (int i in 0) {} // C3285
array<int> ^p = { 1, 2, 3 };
for each (int j in p) {} // OK
}