次の方法で共有


コンパイラの警告 (レベル 3) CS0168

更新 : 2007 年 11 月

エラー メッセージ

変数 'var' は割り当てられていますが、その値が使用されていません。

変数を宣言しても使用しない場合に、この警告が生成されます。

次の例では警告 CS0168 が 2 回発生します。

// CS0168.cs
// compile with: /W:3
public class clx
{
   public int i;
}

public class clz
{
   public static void Main()
   {
      int j = 0;   // CS0168, uncomment the following line
      // j++;
      clx a;       // CS0168, try the following line instead
      // clx a = new clx();
   }
}