1
Reply

C sharp conversions

mukul chakravarty

mukul chakravarty

Jun 12 2013 6:11 PM
928

Why int[] cannot be implicitly converted to system.Array ??

example: I wanted to do this-

int[] a=new int[5];

a=(int[])Enum.GetValues(typeof(post));

where post is an enum. Why did we require to cast LHS to int[]?? The GetValues() method returns arrays only..


Answers (1)