在C#中Array.ToArray()执行深拷贝? [英] In c# does Array.ToArray() perform a DEEP copy?
本文介绍了在C#中Array.ToArray()执行深拷贝?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这应该是pretty基本的问题,但我一直有一个小麻烦找到一个明确的答案。
This should be a pretty basic question, but I've been having a little trouble finding a definite answer.
当您有值的数组并使用 .ToArray()
方法,它创建一个数组的深或浅拷贝?
When you have an array of values and you use the .ToArray()
method does it create a deep or shallow copy of the array?
推荐答案
没有。
您可以很容易地写一个小程序来测试验证这一点。
You can easily verify this by writing a small program to test.
这篇关于在C#中Array.ToArray()执行深拷贝?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文