नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'class' : a nested class cannot have an assembly access specifier as part of its declaration
Remarks
When applied to a managed type, such as class or struct, the public and private keywords indicate whether the class will be exposed through assembly metadata. public or private cannot be applied to a nested class, which will inherit the assembly access of the enclosing class.
When used with /clr, the ref and value keywords indicate that a class is managed (see Classes and Structs).
Example
The following example generates C3379:
// C3379a.cpp
// compile with: /clr
using namespace System;
public ref class A {
public:
static int i = 9;
public ref class BA { // C3379
// try the following line instead
// ref class BA {
public:
static int ii = 8;
};
};
int main() {
A^ myA = gcnew A;
Console::WriteLine(myA->i);
A::BA^ myBA = gcnew A::BA;
Console::WriteLine(myBA->ii);
}