Conversion double array to byte array

后端 未结 7 1224
面向向阳花
面向向阳花 2020-12-01 16:35

How do I convert a double[] array to a byte[] array and vice versa?

class Program
{
    static void Main(string[] args)
    {
              


        
相关标签:
7条回答
  • 2020-12-01 17:24
    double[] array = new double[] { 10.0, 20.0, 30.0, 40.0 };
    byte[] convertedarray = array.Select(x => Convert.ToByte(x)).ToArray();
    
    0 讨论(0)
提交回复
热议问题