1. ## 2D array

Hi everyone,

I want to create a two dimensional array whose size is 54*54.But I want to insert all the elements in program itself.How i do that.

eg:array elements(54*54)

Code:
```value weight[no_vertices] [no_vertices] =
{
{  5, 10 , 12, 45, 23, .........................}
{45,  20, 11, 43, 60, ..........................}
{20 ......................................................}
{22, ....................................................}
{...........................................................}

};```
the problem is page is not enough.
i want to insert all the elements in the program, any method to do that.
thanks in advanced.(above is the example that i want to insert)

2. Originally Posted by prdeepss
Hi everyone,

I want to create a two dimensional array whose size is 54*54.But I want to insert all the elements in program itself.How i do that.

eg:array elements(54*54)

Code:
```value weight[no_vertices] [no_vertices] =
{
{  5, 10 , 12, 45, 23, .........................}
{45,  20, 11, 43, 60, ..........................}
{20 ......................................................}
{22, ....................................................}
{...........................................................}

};```
the problem is page is not enough.
i want to insert all the elements in the program, any method to do that.
thanks in advanced.(above is the example that i want to insert)
Leave off the space after the comma. The compiler doesn't need it. Ignore the width of the page, and don't hit enter, either.

You'll need a comma at the end of every row's curly brace.

3. Isn't the Statement for creating multidimensional arrays in C# <type> <arrayName>[index1,index2,index n]; ? or does the C way also work?

4. Good catch WDT!

I thought "value" was a name for a struct.

You need something like this for an array of integers:

Code:
```i/all your int's, with each row surrounded by curly braces,
and after each rows curly brace, add a comma (not a semi-colon, a comma), except on the last row. Put a semi-colon after the last curly brace, like so:

ArrayName[54][54] = {
{1,2,3},
{4,5,6},
{7,8,9} };```
270 integers seems like a *lot* of integers to add by hand. I'd still suggest a file with the data, and have your program read the data.