Freigeben über


Compilerfehler C3271

"Member": Ungültiger Wert "Wert" für das FieldOffset-Attribut.

Bemerkungen

Es wurde eine negative Zahl an das FieldOffset -Attribut übergeben.

Example

Im folgenden Beispiel wird C3271 generiert:

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

[StructLayout(LayoutKind::Explicit)]
value class MyStruct1 {
   public: [FieldOffset(0)] int a;
   public: [FieldOffset(-1)] long b;   // C3271
};