简体   繁体   中英

how to create two dimensional Array of type bool in C#

I have a matrix kind datagrid in my WPF application and I would like to create a two dimensional Array to access the row and column of the datagrid . how to access the datagridcells using 2-dimensional arrays of type bool, since my result will be of type Boolean.

for each [i][j] of this 10 x 10 rows, column array, I have to query

for example

[0][0] = result of one query

[0][1] = result of another query

EDIT

What I have tried

bool[,] cell = new bool[10, 10];

        for (int i = 0; i < 10; i++)
        {
            for(int j= 0; j<10 ;j++)
            {
            cell[i,j] = (); // what to write here 
            }
        }

You can define 2D arrays in C#:

var array2D = new int[13, 100];
array2D[7, 11] = 48;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM