Multi Dimension Arrays

S

SouthSpawn

If I have an array that is
string[,] MyArray = new string[1,1]

Then I do the following.

string[0,0] = "A";

How can I "ReDimension" my multi dimension array?

In VB.Net they have the ReDim Keyword.

Thanks,
Mark
 
J

Jon Skeet [C# MVP]

SouthSpawn said:
If I have an array that is
string[,] MyArray = new string[1,1]

Then I do the following.

string[0,0] = "A";

How can I "ReDimension" my multi dimension array?

In VB.Net they have the ReDim Keyword.

Arrays are of a fixed size in .NET - even VB.NET basically just creates
a new array and copies the contents of the old array into it. You just
need to do it explicitly in C#.

Have a look at Array.Copy, which should help you.
 

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

Top