Arrays in .net
How can we create arrays in .net?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 4, 2012, 6:24 PM EST
Please refer the below links
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11232005064036AM/WorkingWithArrays.aspx
http://csharp.net-tutorials.com/basics/arrays/
Thanks
Nipun TomarRank #90 · 23K reputationPosted Jan 4, 2012, 6:25 PM EST
I think the below links are very much useful:
http://msdn.microsoft.com/en-us/library/aa289500%28v=vs.71%29.aspx
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11232005064036AM/WorkingWithArrays.aspx
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 4, 2012, 6:42 PM EST
following way to define array in .net.
Single-dimensional arrays:
int[] numbers;
int[] numbers = new int[5];
int[] numbers = new int[5] {1, 2, 3, 4, 5};
Multidimensional arrays:
string[,] names;
string[,] names = new string[5,4];
string[,] names = new string[2,2] { {"Mike","Amy"}, {"Mary","Albert"} };
but my suggestion use generic list instead of array.
List number = new List();
List names = new List();
hope this help.
Vijay YadavRank #1,637 · 943 reputationPosted Jan 4, 2012, 6:56 PM EST
Sam HobbsRank #107 · 20.5K reputationPosted Jan 4, 2012, 7:24 PM EST