I am using Visual Studio, .NET 8.0.
There is my code:
using System;
using System.Globalization;
namespace Learn
{
class Program
{
public static void Main(string[] args)
{
int c;
int[] arr;
c = int.Parse(Console.ReadLine());
for (int i = 0; i <= c - 1; i++)
{
arr[i] = int.Parse(Console.ReadLine());
}
}
};
}
I tried to input this:
3
1
1
1
I get an error CS0165
How to fix that?
>Solution :
you can use List instead of array