Posts

Showing posts with the label Multi-dimensional array

Initializing variable in c#.net ?

We are learning a new language daily so we need to remember how too initialize variables in c#.net so bookmark this and use it as your daily guidebook to initialize variable in c#.net. Initialize variables in C#.net Single Dimensional Array  Integers <code> int[] n1= new int[4]{2,3,1,4}; int[] n2= new int[]{1,2,3,4}; int[] n3= {1,2,3,4,}; </code> Strings <code> string[] s1= new string[4]{"tom","jerry","harry","ben"}; string[] s2= new string[]{"tom","jerry","harry","ben"}; string[] s3= {"tom","jerry","harry","ben"}; </code> Multi-dimensional array. Integer <code> int[,] n1 = new int[3, 2] { {1, 2}, {3, 4}, {5, 6} }; int[,] n2 = new int[,] { {1, 2}, {3, 4}, {5, 6} }; int[,] n3 = { {1, 2}, {3, 4}, {5, 6} }; </code> String <code> string[,] n1 = new string["...