M
Mark Broadbent
I have a list of Widget objects that have been added to an ArrayList.
I now would like to create an array of Widget s.
ArrayList.ToArray() returns an array of object type so...
ideally what I would like is something like this
Widget[] myWidgets = (Widget[]) ArrayList.ToArray();
Now, I know why this won't work but is there an easier way to do this
without being forced to iterate through the object array and cast each
element to a new Widget array?
Thanks.
Br,
Mark.
I now would like to create an array of Widget s.
ArrayList.ToArray() returns an array of object type so...
ideally what I would like is something like this
Widget[] myWidgets = (Widget[]) ArrayList.ToArray();
Now, I know why this won't work but is there an easier way to do this
without being forced to iterate through the object array and cast each
element to a new Widget array?
Thanks.
Br,
Mark.