a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
28 lines
341 B
C#
28 lines
341 B
C#
// Compiler options: -unsafe
|
|
|
|
unsafe struct S
|
|
{
|
|
public short nData;
|
|
public fixed int Data [1];
|
|
}
|
|
|
|
unsafe struct S2
|
|
{
|
|
public uint Header;
|
|
public fixed byte Data [5];
|
|
|
|
public void Test ()
|
|
{
|
|
fixed (byte* bP = Data) {
|
|
S* p = (S*) bP;
|
|
p = (S*) (p->Data + p->nData);
|
|
}
|
|
}
|
|
|
|
public static void Main ()
|
|
{
|
|
new S2 ().Test ();
|
|
}
|
|
}
|
|
|