Compiler Error CS0133
The expression being assigned to 'variable' must be constant
A const variable cannot take as its value an expression that is not constant. For more information, see Constants.
The following sample generates 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()
{
}
}
Schafft mat eis op GitHub zesummen
D'Quell fir dësen Inhalt kann op GitHub fonnt ginn, wou Dir och Theeme schafen an iwwerpréiwen kënnt an Ufroen unhuele kënnt. Fir méi Informatiounen, gitt op eisen Auteur-Guide.
Feedback zu .NET
.NET ass en Open-Source-Projet. Wielt e Link, fir Feedback ze ginn: