daily update on 20230320 by nitload youmu

This commit is contained in:
Nitload
2023-03-20 01:45:49 +08:00
parent 167e33a3dd
commit db2ca36fd7
100 changed files with 1211 additions and 746 deletions
-32
View File
@@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp
{
//对4字节空间的联合体的C#实现
[StructLayout(LayoutKind.Explicit, Size = 4)]
public struct Union4
{
[FieldOffset(0)]
public byte b0;
[FieldOffset(1)]
public byte b1;
[FieldOffset(2)]
public byte b2;
[FieldOffset(3)]
public byte b3;
//得到对应的int值
[FieldOffset(0)]
public uint i;
//得到对应的float值
[FieldOffset(0)]
public float f;
}
}
-30
View File
@@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp
{
//对8字节空间的联合体的C#实现
[StructLayout(LayoutKind.Explicit, Size = 8)]
public struct Union8
{
[FieldOffset(0)]
public byte b0;
[FieldOffset(1)]
public byte b1;
[FieldOffset(2)]
public byte b2;
[FieldOffset(3)]
public byte b3;
//得到对应的int值
[FieldOffset(0)]
public int i1;
[FieldOffset(4)]
public int i2;
//得到对应的float值
[FieldOffset(0)]
public double f;
}
}