नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
implicit box of integer 0; use nullptr or explicit cast
Remarks
Visual C++ features implicit boxing of value types. An instruction that resulted in a null assignment using Managed Extensions for C++ now becomes an assignment to a boxed int.
For more information, see Boxing.
Example
The following example generates C4965.
// C4965.cpp
// compile with: /clr /W1
int main() {
System::Object ^o = 0; // C4965
// the previous line is the same as the following line
// using Managed Extensions for C++
// System::Object *o = __box(0);
// OK
System::Object ^o2 = nullptr;
System::Object ^o3 = safe_cast<System::Object^>(0);
}