Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please i'm beginner
i need accurate explain about array by c# including sorting array
Posted

1 solution

An array is a sequence of objects of the same type, which can be referered to by a collective name, and accessed via an index to that name (normally integer, but sometimes string).

For example:
C#
string[] myStrings = new string[] ("A string", "Another string"};
Console.WriteLine(myStrings[0]);
"myStrings" is the collective name, and "0" is the index of the first string.
Sorting an array is very simple:
C#
Array.Sort(myArray);
Will do it.

What else do you want to know?
 
Share this answer
 
Comments
BobJanova 5-Mar-12 7:40am    
I gave you a 5, but in C#, arrays are always sequential, fixed length and indexed by integer. The more general case, including 'associative arrays' (i.e. arrays indexed by string or other object, or sparse keys), and variable length vectors, would be covered by 'collection' in C#/.Net terminology.
[no name] 5-Mar-12 7:49am    
for that,you have to use another namespace,

using System.Collection;
Perić Željko 6-Mar-12 3:24am    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900