Hi,
I am using C# in visual studio 2005
How can I convert a list into an array in c#. I now that vb allows you to convert a list into an array.
void myFunc()
{
List<myObj> myList = new List<myObj>
//Asumen that I have created myObj1, myObj2, myObj3 and I add these objects to the list.
myList.Add(myObj1);
myList.Add(myObj2);
myList.Add(myObj3);
//I need to call this method and convert _myList into an array because the method is expending an array
//not a List<T>. In Visual Basic, I can convert a list into an array, example, method1(_myList.ToArray)
//I need to do this because I am calling a webservice from another company and the the proxy contains
// this method.
method1(_myList ) ;
}
void method1(myObjmy myArr[])
{
//do something
}
Please, look at the error that I am getting in the error section
Start Free Trial