更新:2007 年 11 月
错误消息
变量“name”在声明之前无法使用。
变量在使用之前必须声明。
更正此错误
- 将变量声明移至发生该错误的行之前。
示例
下面的示例生成 CS0841:
// cs0841.cs
using System;
public class C
{
public static int Main()
{
j = 5; // CS0841
int j; // To fix, move this line up.
return 1;
}
}