How can we dynamically allocate and grow an array

前端 未结 8 1808
伪装坚强ぢ
伪装坚强ぢ 2020-12-05 16:01

I am working on a project, but I cannot use any existing java data structures (ie, ArraysList, trees, etc)

I can only use arrays. Therefore, I need to dynamically up

8条回答
  •  眼角桃花
    2020-12-05 17:01

    Visual Basic has a nice function : ReDim Preserve.

    Someone has kindly written an equivalent function - you can find it here. I think it does exactly what you are asking for (and you're not re-inventing the wheel - you're copying someone else's)...

提交回复
热议问题