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

后端 未结 15 1696
盖世英雄少女心
盖世英雄少女心 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条回答
  •  -上瘾入骨i
    2020-12-13 03:29

    Look at the generic List as a replacement for arrays. They support most of the same things arrays do, including allocating an initial storage size if you want.

提交回复
热议问题