C#转换Byte数组转换为一个float [英] C#: Convert Byte array into a float

查看:215
本文介绍了C#转换Byte数组转换为一个float的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大小4的字节数组

byte[] source = new byte[4];

现在我想这个来源转换为4字节浮点值...

Now I wanted to convert this source into a 4-byte float value...

谁能告诉我如何做到这一点...

Can anyone tell me how to do this...

推荐答案

尝试

浮动myFloat = System.BitConverter.ToSingle(mybyteArray,则startIndex);

这篇关于C#转换Byte数组转换为一个float的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆