Int[] test = new int[7]
how to change test to a dynamic array?
There's no real notion of a stack allocated "static" array in C# (ignoring unsafe context and stackalloc). What you just wrote is a dynamic array. It's an object created at runtime on the managed heap. The size can be an expression or variable. For instance:
int[] a = new int[int.Parse(Console.ReadLine())];
If by dynamic array, you mean an array you can resize easily (like vector in C++), you should use List<T>:
List<int> a = new List<int>();
a.Add(10);
Actually, this can be achieved by using the ToList() extension method (you will need to import the System.Linq namespace). Here is an example:
int[] numbers = { 2, 3, 4, 5 };
IList<int> numbersDynamic = numbers.ToList();
That would give you a list class that you can manipulate as needed.