I 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 using:
listItem[] myArray = myList.ToArray();
Unfortunately, this does not work, and I get this error message:
Cannot convert [...] listItem[] to [...] List<listItem>
I tried to figure it out, but very unsuccessfully ...
Thanks in advance.
EDIT: My failure, the first line of code I wrote was really wrong!
Actually, all the code above works very well. My error was due to the fact that my function:
List<listItem> myFunction()
returns myArray, therefore the conversion problem ... Now it is fixed. :)
Thank you all for your answers.
Jodll
source share