Venciity

[Jumpstart C#] Multidimensional-Arrays - example: Creating

Feb 25th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CreatingMultidimensionalArray
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] myIntArray = new int[3, 2]
  14.             {
  15.                 {1,2},
  16.                 {2,3},
  17.                 {4,1},
  18.             };
  19.  
  20.  
  21.  
  22.             int[,] intMatrix =
  23.             {
  24.                {1, 3, 6, 2}, //row 0 values
  25.                {8, 5, 9, 1}, //row 1 values
  26.                {4, 7, 3, 0}  //row 2 values
  27.             }; //The matrix size is 3 x 4 (3 rows, 4 columns)
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment