更新 : 2007 年 11 月
エラー メッセージ
foreach ステートメントには、型と識別子の両方が必要です。
foreach ステートメントの形式が不正です。
次の例では CS0230 エラーが生成されます。
// CS0230.cs
using System;
class MyClass
{
public static void Main()
{
int[] myarray = new int[3] {1,2,3};
foreach (int in myarray) // CS0230
// try the following line instead
// foreach (int x in myarray)
{
Console.WriteLine(x);
}
}
}