Error in C# array declaration

Question from Malsha Rajapaksha

IMG-20200521-WA0000

2 Likes

@Sakuntha can you manage ayya?

2 Likes

a field initializer cannot reference the nonstatic property. so you need to put “static” keyword in your len variable.

Ex :
public static int len = 0;
public int[] A1 = new int[len];

1 Like

@Malsha_Rajapaksha