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 7278057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:49:24+00:00 2026-05-28T22:49:24+00:00

this must be answered some time in the past, however I could not a

  • 0

this must be answered some time in the past, however I could not a particular way that I was looking for.
I want to make an array dimension of 7 x 2;

ex)

{0,0} {0,0}
{0,0}
...
...
..
.

int [,] myArray = new int[7,2];

Then I tried to treat each dimension of an array like one dimensional array.
So I tried to assign values to the array this way…


int[0] = new int{ 1, 2};

I think it should then look like…

{1 , 2}
{0 , 0}
...
..
.

but i get an error.

I believe it is due to my incomplete understanding of an array class.

  • 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-05-28T22:49:25+00:00Added an answer on May 28, 2026 at 10:49 pm

    What you want is a jagged array, not a multidimentional array. Essentially, an array of arrays:

    int[][] myArray = new int[7][];
    int[0] = new int {1, 2};
    

    The second “dimension” arrays are not bounded to a length of 2 however- you need to enforce that manually. This is why they are called jagged- visually, they can be of varying lengths:

    {
      { 3, 2 },
      { 1, 8, 3 },
      { 9, 6, 3, 4 },
      { 4, 2, 8 },
      { 4, 9, 3, 4, 5 },
      { 2, 2 }
    }
    

    All about arrays in C# here: http://msdn.microsoft.com/en-us/library/aa288453(v=vs.71).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this question must have been asked and answered a million times,
First, apologies for asking something that must be answered here somewhere (I've been looking!)
I know that this question must have been answered plenty of times already, but
This must have been answered previously, but my Google powers are off today and
This must be really obvious, but how do I make a winsock listen to
This task has already been asked/answered, but I recently had a job interview that
(I'm sure this must have been answered on this site already, but search gets
I know this must have been answered before here, but I simply can't find
I've looked for similar questions, but this must have been asked before. Either way,
I'm sure this must have been answered somewhere, but I can't find it for

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.