नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'member': an initonly static data member must be initialized
Remarks
A variable marked with initonly was not initialized correctly.
Example
The following example generates C3883:
// C3883.cpp
// compile with: /clr
ref struct Y1 {
initonly
static int staticConst1; // C3883
};
The following example demonstrates a possible resolution:
// C3883b.cpp
// compile with: /clr /c
ref struct Y1 {
initonly
static int staticConst2 = 0;
};
The following example shows how to initialize in a static constructor:
// C3883c.cpp
// compile with: /clr /LD
ref struct Y1 {
initonly
static int staticConst1;
static Y1() {
staticConst1 = 0;
}
};