janvdl
Newcomer
Hello everyone
Well I'm busy with a homework assignment on copying 4 arrays each to a seperate arraylist.
The first array is of type int, the second string, then char, then decimal.
I tried using the CopyTo() method but then I get errors about the size of the arraylist or something, because I use the ToArray() method on the destination arraylist. So I decided to do it as follows:
And so I repeat that for all 4 the arrays.
---
But how would I have proceeded if i wanted to use the CopyTo() method? Must I declare a fixed size for the arraylist when using the ToArray() method? It won't really be very elegant programming. What are your opinions?
Well I'm busy with a homework assignment on copying 4 arrays each to a seperate arraylist.
The first array is of type int, the second string, then char, then decimal.
I tried using the CopyTo() method but then I get errors about the size of the arraylist or something, because I use the ToArray() method on the destination arraylist. So I decided to do it as follows:
Code:
ArrayList myArrayList = new (iArray);
And so I repeat that for all 4 the arrays.
---
But how would I have proceeded if i wanted to use the CopyTo() method? Must I declare a fixed size for the arraylist when using the ToArray() method? It won't really be very elegant programming. What are your opinions?