|
-
January 30th, 2005, 07:44 PM
#1
How can I dynamically increase an array in C#
or delete a part of it, similar to C++: CArray.Add()/RemoveAt().
Through ArrayList and using Buffer.BlockCopy I can double it but what about removing a part of it.
Last edited by ser; January 30th, 2005 at 08:05 PM.
Reason: 1
-
January 30th, 2005, 08:29 PM
#2
Re: How can I dynamically increase an array in C#
sorry, I think I've found a solution. Queue method looks like exceeding my requirements.
-
January 31st, 2005, 03:04 AM
#3
Re: How can I dynamically increase an array in C#
What is wrong about ArrayList? I think it is the right class for you. Or do you want the array to physicaly cut allocated memory if removing elements? This is not good demand. If memory is already allocated to the array, it cost nothing to keep it allocated event empty. Shrinking the allocated memory is unnecessary overhead, because, the managed memory has to be reorganized.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|