2013年7月30日 星期二

int[] Cast through IEnumerable<object>.ToArray()

int[] intArray = { 1, 2, 3, 4, 5 };
SimpleStructure[] sstructArray =
{ new SimpleStructure(1, "One"), new SimpleStructure(2, "Two") };
// For value types, cast through IEnumerable<object>.ToArray()
AcceptsAnArray(intArray.Cast<object>().ToArray());
AcceptsAnArray(sstructArray.Cast<object>().ToArray());

image


image


image













































  

沒有留言:

張貼留言