dynamic arrays

S

soosan

hi i dont know the size of my array. how do i create dynamic arrays in c#?
like vb allows redim and preserve i havent come across anything like that in
c#

thanx
 
J

Jon Skeet [C# MVP]

soosan said:
hi i dont know the size of my array. how do i create dynamic arrays in c#?
like vb allows redim and preserve i havent come across anything like that in
c#

Well, VB is just making it more convenient to create a new array and
copy over the contents of the old one. It's not really a dynamically
sized array.

For the most part, however, the solution is to use ArrayList.
 
C

Cor

Hi Soosan,

In addition to Jon,

If an array is dynamic in VB.net than it is also much easier to use an
arraylist

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dynamic array in VB NET 2
Access Accessing arrays within loop - VBA 1
Dynamic arrays 4
Speed of fixed array versus dynamic array 8
redim preserve 3
Array of Public Arrays 1
Are there Dynamic Arrays in C#? 1
Resizing arrays in C# 7

Top