本文介绍了复制并复制两个二维数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,如何克隆两个二维数组?如何将两个二维数组复制到另一个数组?在此先感谢
Hello,How can I make a clone of a two dimentional array?How can I copy a two dimentional array to another one? Thanks in advance
推荐答案
int[,] a;
a = new int[2, 2];
// initialize a elements here
int[,] b = (int[,]) a.Clone(); // make a copy
int[,] original = new int[2,2] { { 1 ,2 } , { 3, 4 } };
int[,] copy = (int[,]) original.Clone();
问候,
Regards,
这篇关于复制并复制两个二维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!