110,545
社区成员
发帖
与我相关
我的任务
分享
byte[] myP = new byte[4];
myP[0] = 49;
myP[1] = 50;
myP[2] = 51;
myP[3] = 52;
//a显示为0.000000166889336
float a = (float)Marshal.PtrToStructure(Marshal.UnsafeAddrOfPinnedArrayElement(myP, 0), typeof(float));
ASCIIEncoding encoding = new ASCIIEncoding();
//constructedString 显示为1234
string constructedString = encoding.GetString(myP);
byte[] pchrealimeInfo = ...
for (System.Int32 i = 0; i < 20; i++)
{
pTemp[i] = System.BitConverter.ToInt32(pchrealimeInfo, i * 4);
}