In C # does Array.ToArray () execute a DEEP copy?

This should be a fairly simple question, but I had a little problem finding a specific answer.

When you have an array of values โ€‹โ€‹and you use the .ToArray() method, does it create a deep or shallow copy of the array?

+6
source share
1 answer

Not.

You can easily verify this by writing a small testing program.

+13
source

Source: https://habr.com/ru/post/914562/


All Articles