Initialize array in C#.Net

praveenkumar205

New Member
Hi..I am new to C#.I would like to initialize an array in C#.net.Do i write it in this manner?<BR><BR><coding><BR> for (i=0;i<=9;i++)<BR> {<BR> imp_arr = "";<BR> <BR> }<BR></coding>//Declaration<BR>string[] strVariable;<BR>//Initialize<BR>strVariable = new string[10]; //10 is the number of elements u<BR> //want to have in the array<BR>//Dynamic Declaration and Initialiazation<BR>int NoofElements = 10;<BR>string[] strVariable = new string[NoofElements];<BR>//You can access the elements<BR>for(int i=0;i<NoofElements;i++)<BR> strVariable
 
Top