arrays in .net
How can we create arrays in .net?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Jan 5, 2012, 12:24 AM
Vijay YadavPosted Jan 4, 2012, 11:56 PM
Jignesh TrivediPosted Jan 4, 2012, 11:42 PM
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.
Nipun TomarPosted Jan 4, 2012, 11:25 PM
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
Satyapriya NayakPosted Jan 4, 2012, 11:24 PM
Please refer the below links
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11232005064036AM/WorkingWithArrays.aspx
http://csharp.net-tutorials.com/basics/arrays/
Thanks