Rectangular arrays Vs. multidimensional arrays.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nikhil Patel

    #1

    Rectangular arrays Vs. multidimensional arrays.

    Hi all,
    I am readin an MSDN tutorial on C# arrays. It says,

    you can have a three-dimensional rectangular array:
    int[,,] buttons = new int[4,5,3]; What I don't understand is how can a
    three dimensional array be a rectangular array because a rectangle can have
    only two dimensions.Than ks in advance...-Nikhil


  • Jon Skeet

    #2
    Re: Rectangular arrays Vs. multidimensiona l arrays.

    Nikhil Patel <nikhil0100@aol .com> wrote:[color=blue]
    > I am readin an MSDN tutorial on C# arrays. It says,
    >
    > you can have a three-dimensional rectangular array:
    > int[,,] buttons = new int[4,5,3]; What I don't understand is how can a
    > three dimensional array be a rectangular array because a rectangle can have
    > only two dimensions.Than ks in advance...-Nikhil[/color]

    It's really just a label for it - commonly they'll have two dimensions,
    but there's no need for it to be like that. I guess a three-dimensional
    rectangular array is really a cuboid array, and then it goes into
    hyper-cuboid etc, but it's easiest just to keep calling them all
    rectangular arrays.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Peter N Roth

      #3
      Re: Rectangular arrays Vs. multidimensiona l arrays.

      Rectangular in this context means that
      each dimension is a constant, rather
      than specifying the length of each "row"
      in what is known as a matrix with a
      "ragged edge".

      --
      Grace + Peace,
      Peter N Roth
      Engineering Objects International



      "Nikhil Patel" <nikhil0100@aol .com> wrote in message
      news:%2330tNhwT DHA.3796@tk2msf tngp13.phx.gbl. ..[color=blue]
      > Hi all,
      > I am readin an MSDN tutorial on C# arrays. It says,
      >
      > you can have a three-dimensional rectangular array:
      > int[,,] buttons = new int[4,5,3]; What I don't understand is how can a
      > three dimensional array be a rectangular array because a rectangle can[/color]
      have[color=blue]
      > only two dimensions.Than ks in advance...-Nikhil
      >
      >[/color]


      Comment

      Working...