नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : invalid target type for pointer_type
Remarks
An interior_ptr or pin_ptr was declared incorrectly.
Examples
The following example generates C3833:
// C3833.cpp
// compile with: /clr
ref class MyClass {
public:
int data;
MyClass() : data(35) {}
};
int main() {
interior_ptr<MyClass> p; // C3833
// OK
MyClass ^ h_MyClass = gcnew MyClass;
interior_ptr<int> i = &(h_MyClass->data);
System::Console::WriteLine(*i);
}
The following example generates C3833:
// C3833b.cpp
// compile with: /clr /c
ref class G {
public:
int i;
};
int main() {
G ^ pG = gcnew G;
pin_ptr<G> ppG = &pG; // C3833 can't pin a whole object
// OK
pin_ptr<int> ppG2 = &pG->i;
*ppG2 = 54;
int * pi = ppG2;
System::Console::WriteLine(*pi);
System::Console::WriteLine(*ppG2);
*pi = 55;
System::Console::WriteLine(*pi);
System::Console::WriteLine(*ppG2);
*ppG2 = 56;
System::Console::WriteLine(*pi);
System::Console::WriteLine(*ppG2);
}