Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All

I am a bigneer programmer i have no idia to difine array in c# , kindly help me

thanks in advance
Posted
Comments
[no name] 30-Jan-13 10:34am    
very nice! thanks for accept Answer
PIEBALDconsult 30-Jan-13 10:52am    
If possible, use a List or other collection rather than array.
Kishor Deshpande 30-Jan-13 11:35am    
Hmm, List would be a better choice :)

Please pick a book or search Google/Online material before asking such basic questions.
Start from here:
MSDN: Arrays Tutorial[^]
C# String Arrays[^]

Various ways:
C#
// various ways
string[] arr1 = new string[] { "one", "two", "three" };

string[] arr2 = { "one", "two", "three" };

var arr3 = new string[] { "one", "two", "three" };

string[] arr4 = new string[3];
arr4[0] = "one";
arr4[1] = "two";
arr4[2] = "three";
 
Share this answer
 
Dear Gourav

try it:
string[] ano={"A","B","C","D","E","F","G","H","I","J"};
 
Share this answer
 

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