I've created a class called listItem and the following list:
List<listItem> myList = new List<listItem>();
At some point in my code, I want to convert it to an array, thereby using:
listItem[] myArray = myList.ToArray();
Unfortunately, this doesn't work, and I get this error message:
Cannot convert [...] listItem[] to [...] List<listItem>
I tried to figure this out, but very unsuccessfully...
Thanks in advance.
EDIT: My bad, the first code line I wrote was indeed mistyped!
Actually, all the code above works pretty well. My error was due to the fact that my function:
List<listItem> myFunction()
returned myArray, hence the conversion problem... It is now fixed. :)
Thank you all for your answers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With