Aracılığıyla paylaş


Derleyici Hatası C3272

'symbol' : StructLayout(LayoutKind::Explicit) ile tanımlanan tür adının bir üyesi olduğundan, simge FieldOffset gerektirir

Açıklamalar

Etkin olduğunda StructLayout(LayoutKind::Explicit) , alanlar ile FieldOffsetişaretlenmelidir.

Example

Aşağıdaki örnek C3272 oluşturur:

// C3272_2.cpp
// compile with: /clr /c
using namespace System;
using namespace System::Runtime::InteropServices;

[StructLayout(LayoutKind::Explicit)]
ref struct X
{
   int data_;   // C3272
   // try the following line instead
   // [FieldOffset(0)] int data_;
};