+ Reply to Thread
Results 1 to 2 of 2

Thread: Creating multidimensional arrays in C#

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    1

    Creating multidimensional arrays in C#

    Hi Everyone,

    Can you show me how to create 2 or 3 dimensional array in C#?

    Thanks!

  2. #2
    Junior Member
    Join Date
    Dec 2011
    Posts
    1
    Creating 2 dimensional array:
    int[ , ] myArray = new int[5,3];

    myArray[0,1] = 12; // This is how you assign

    Creating 3 dimensional array:

    int[ ,, ] myArray2 = new int[5,3,2];
    myArray[0,2,1] = 12; // This is how you assign

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts