Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
Dear All
 
I am a bigneer programmer i have no idia to difine array in c# , kindly help me
 
thanks in advance
Posted 30-Jan-13 4:28am

Comments
vivek511 - 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 :)

2 solutions

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:
// 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";
  Permalink  
Dear Gourav
 
try it:
string[] ano={"A","B","C","D","E","F","G","H","I","J"};
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Christian Graus 538
1 Ron Beyer 286
2 samadhan_kshirsagar 229
3 Tadit Dash 213
4 OriginalGriff 198
0 Sergey Alexandrovich Kryukov 7,017
1 Prasad_Kulkarni 3,815
2 OriginalGriff 3,557
3 _Amy 3,372
4 CPallini 3,010


Advertise | Privacy | Mobile
Web04 | 2.6.130619.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid