First of all, a .NET collection such as ArrayList might be preferable.
However, if you want to resize an array, then the following is what you need:
(assuming an array of type "SomeType")
SomeType[] temp = new SomeType[11];
if (A != null)
Array.Copy(A, temp, Math.Min(A.Length, temp.Length));
A = temp;
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter
"Niklas" wrote:
Hi
What is the best way to enlarge an C# array which already have values?
In VB.NET I would do
ReDim Preserve A(10)
regards
/Niklas