Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:57:35+00:00 2026-06-09T18:57:35+00:00

What is the difference between the two syntaxes?

  • 0

What is the difference between the two syntaxes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:57:36+00:00Added an answer on June 9, 2026 at 6:57 pm

    The first one is a multi dimensional array while the second is a jagged array. You can take a look at this question to get a description of the diffrerence between the two, but here is an important snippit:

    A multidimensional array creates a nice linear memory layout while a
    jagged array implies several extra levels of indirection.

    Looking up the value jagged[3][6] in a jagged array var jagged = new
    int[10][5] works like this: Look up the element at index 3 (which is
    an array) and look up the element at index 6 in that array (which is a
    value). For each dimension in this case, there’s an additional look up
    (this is an expensive memory access pattern).

    A multidimensional array is laid out linearly in memory, the actual
    value is found by multiplying together the indexes. However, given the
    array var mult = new int[10,30] the Length property of that
    multidimensional array returns the total number of elements i.e. 10 *
    30 = 300.

    The Rank property of a jagged array is always 1, but a
    multidimensional array can have any rank. The GetLength method of any
    array can be used to get the length of each dimension. For the
    multidimensional array in this example mult.GetLength(1) returns 30.

    Indexing the multidimensional array is faster e.g. given the
    multidimensional array in this example mult[1,7] = 30 * 1 + 7 = 37,
    get the element at that index 37. This is a better memory access
    pattern because only one memory location is involved, which is the
    base address of the array.

    A multidimensional array therefore allocates a continuous memory
    block, while a jagged array does not have to be square like. e.g.
    jagged1.Length does not have to equal jagged[2].Length which would
    be true for any multidimensional array.

    Update:

    One major difference between the multi and jagged array is that a multi must always be “square”, meaning that any two indexes will have the same number of elements in their child arrays. A jagged array does not have this requirement. Take a look at the code below:

    var jagged = new int[3][]; //not defining the size of the child array...
    var multi = new int[3,8]; //defining a 3x8 "square"
    var multiBad = new int[3,]; //Syntax error!
    var jaggedSquare= new int[3][8]; //another 3x8 "square"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between these two syntaxes ? Type AnIntType = Integer; AnotherIntType
I'd like to know the difference between this two syntaxes: return db.Contacts.First(x => x.ContactID
Possible Duplicate: Calculating the Difference Between Two Java Date Instances How do I get
I want to get difference between two times. I calculate this by using following.
What is the difference between two ways to obtain a string from resources: setPositiveButton(R.string.some_string);
I want to calculate the difference between two times, one of which is the
Possible Duplicate: How to calculate the difference between two dates using PHP? I have
Possible Duplicate: How to calculate the difference between two dates using PHP? When a
Possible Duplicate: How to calculate the difference between two dates using PHP? how can
How can I get the difference between two times in a Batch file? Because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.