नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : cannot use 'new' on the reference type; use 'gcnew' instead
Remarks
To create an instance of a CLR type, which causes the instance to be placed on the garbage-collected heap, you must use gcnew.
Example
The following example generates C2750:
// C2750.cpp
// compile with: /clr
ref struct Y1 {};
int main() {
Y1 ^ x = new Y1; // C2750
// try the following line instead
Y1 ^ x2 = gcnew Y1;
}