1
Answer

C sharp conversions

Photo of mukul chakravarty

mukul chakravarty

12y
1.3k
1

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)