Re: [DOTNET] ArrayList.ToArray question

2002-05-09 Thread Reggie Burnett
PROTECTED] > Subject: Re: [DOTNET] ArrayList.ToArray question > > Reggie Burnett [mailto:[EMAIL PROTECTED]] wrote: > > > why doesn't this compile to properly return a StructType[] ? > > You need to cast... ArrayList::ToArray returns an Object[]. > > > ret

Re: [DOTNET] ArrayList.ToArray question

2002-05-09 Thread Marsh, Drew
Reggie Burnett [mailto:[EMAIL PROTECTED]] wrote: > why doesn't this compile to properly return a StructType[] ? You need to cast... ArrayList::ToArray returns an Object[]. return (StructType[])arList.ToArray(typeof(StructType)) HTH, Drew You can read messages from the DOTNET archive, unsubs

[DOTNET] ArrayList.ToArray question

2002-05-09 Thread Reggie Burnett
What is wrong with this? Public struct StructType { Public Int mem1; Public int mem2; } ... after adding several elements of type STructType to an arraylist... return arList.ToArray( typeof(StructType) ) why doesn't this compile to properly return a Stru