我有这个C#代码,它具有3-dim double,然后将其复制到11x3双:
var i = 8;
var temprate = new double[]{1,2,3};
var RATES = new double[11,3]
RATES[i, 0] = temprate[0];
RATES[i, 1] = temprate[1];
RATES[i, 2] = temprate[2];
如何直接将temprate复制到RATES中(最好没有循环)?
即:"RATES[i,*]=temprate"
答案 0 :(得分:0)
Buffer.BlockCopy(temprate, 0, RATES, i * 3 * sizeof(double), 3 * sizeof(double));