Kobi55
asked on
ReDim Preserve(vb6) in C#
Hi
how can i do like "vb6" (ReDim PreserveArray) but in C#
not with ArrayList
regards
how can i do like "vb6" (ReDim PreserveArray) but in C#
not with ArrayList
regards
VB's ReDim Preserve compiles to the following
int[] a = int[16];
// This is the redim stuff
int[] b = int[16];
for (int I = 0; I < a.Length && I < b.Length; I++)
b[I] = a[I];
int[] a = int[16];
// This is the redim stuff
int[] b = int[16];
for (int I = 0; I < a.Length && I < b.Length; I++)
b[I] = a[I];
Sorry, to add to that...
int[] a = int[16];
// This is the redim stuff
int[] b = int[16];
for (int I = 0; I < a.Length && I < b.Length; I++)
b[I] = a[I];
a = b;
int[] a = int[16];
// This is the redim stuff
int[] b = int[16];
for (int I = 0; I < a.Length && I < b.Length; I++)
b[I] = a[I];
a = b;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
int [] a=int[16];
a=int[32];
a[31]=12;
you can create a new int array and assigned to a.
you can change int to other types