The list is built on the top of Array, whereas Array is a lower-level data structure.Key Differences between C# List and Arrayīoth are popular choices in the market let us discuss some of the major differences:
All arrays consist of contiguous memory locations, with the lowest address corresponds to the first element and the highest address to the last element.īelow are the top 8 differences between C# List vs Array
It is used to store a data collection, but the array can be considered a collection of variables of the same type stored at contiguous memory locations. Head To Head Comparison Between C# List and Array (Infographics)Īn array stores a fixed-size sequential collection of elements of the same type. Int steps = new int Ĭopy an array variable into another target array variable:īoth target and source point to the same memory location. Console.WriteLine (“element is : ”+ value) Ĭreate and initialize an array at the same time: