Loading
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 Dec 19, 2013, 8:10 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 19, 2013, 8:34 PM EST
hi,
I thing Array is simple collection of data of same type... there is no such specific type of array.
yes it might be one or Multi-dimensional arrays
please refer
http://www.tutorialspoint.com/csharp/csharp_arrays.htm
http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx
hope this will help you.
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted Dec 19, 2013, 9:18 PM EST
Single-dimensional arrays:
Multidimensional arrays:
Array-of-arrays (jagged):
You can also have larger arrays. For example, you can have a three-dimensional rectangular array:
You can even mix rectangular and jagged arrays. For example, the following code declares a single-dimensional array of three-dimensional arrays of two-dimensional arrays of type int:
// arrays.cs
using System;
class DeclareArraysSample
{
public static void Main()
{
// Single-dimensional array
int[] numbers = new int[5];
// Multidimensional array
string[,] names = new string[5,4];
// Array-of-arrays (jagged array)
byte[][] scores = new byte[5][];
// Create the jagged array
for (int i = 0; i < scores.Length; i++)
{
scores[i] = new byte[i+3];
}
// Print length of each row
for (int i = 0; i < scores.Length; i++)
{
Console.WriteLine("Length of row {0} is {1}", i, scores[i].Length);
}
Console.ReadKey();
}
}
OUTPUTNipun TomarRank #90 · 23K reputationPosted Dec 19, 2013, 9:26 PM EST
Read this article, here you find a clear and simple explanation:
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithArrays11232005064036AM/WorkingWithArrays.aspx
Thanks