Partilhar via


Erro do compilador C3272

'symbol' : symbol requer FieldOffset, pois é um membro do tipo typename definido com StructLayout(LayoutKind::Explicit).

Observações

Quando StructLayout(LayoutKind::Explicit) estiver em vigor, os campos devem ser marcados com FieldOffset.

Example

O exemplo a seguir gera C3272:

// 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_;
};