How and when to abandon the use of arrays in C#?

后端 未结 15 1650
盖世英雄少女心
盖世英雄少女心 2020-12-13 02:58

I\'ve always been told that adding an element to an array happens like this:

An empty copy of the array+1element is created and then the data from t

15条回答
  •  囚心锁ツ
    2020-12-13 03:37

    A standard array should be defined with a length, which reserves all of the memory that it needs in a contiguous block. Adding an item to the array would put it inside of the block of already reserved memory.

提交回复
热议问题