0
double[] src = new[] { 1d, 1d, 2d };
double[] dst = new[] { 0d, 0d, 0d };
Buffer.BlockCopy(src, 0, dst, 0, 3);
for (int i = 0; i < 3; i++)
{
Console.Write(src[i] + " ");
}
Console.WriteLine();
for (int i = 0; i < 3; i++)
{
Console.Write(dst[i] + " ");
}
Console.WriteLine();
輸出
1 1 2
0 0 0
我預期在兩條線上相同的值?
https://dotnetfiddle.net/AH2ebt
哦謝謝你的快速答案,我想我錯過了「複製的字節數」。計數的一部分! – Peter