指派給 'variable' 的運算式必須為常數
const 變數無法接受非常數運算式作為其值。 如需詳細資訊,請參閱常數。
下列範例會產生 CS0133:
// CS0133.cs
public class MyClass
{
public const int i = c; // CS0133, c is not constant
public static int c = i;
// try the following line instead
// public const int i = 6;
public static void Main()
{
}
}