c# 自动增长数组 动态数组

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_41913666/article/details/89395728
/// <summary>
/// 数组拷贝
/// </summary>
/// <param name="source"></param>
/// <param name="destination"></param>
private void CopyBytes(ref double[] source, ref double[] destination)
{
    int index = 0;
    if (destination.Length != 0)
    {
         index = destination.Length - 1;
         double[] numArray = new double[source.Length + destination.Length];
         destination.CopyTo(numArray, 0);
         destination = numArray;
     }
     else
     {
         destination = new double[source.Length];
     }
     source.CopyTo(destination, index);
}

https://blog.csdn.net/weixin_41913666/article/details/89395454

猜你喜欢

转载自blog.csdn.net/weixin_41913666/article/details/89395728