Home>

C #
I don't know how to display characters using a multidimensional array
Create a 3.3 box using a multidimensional or jagged array
□□□
□□□
□□□
I do n’t know how to display

The paper given for school assignments
int [,] a = new int [3,3]
{
{"□","□","□"},
{"□","□","□"},
{"□","□","□"}
};
I received an error code CS0029 with this

Is it different from displaying multi-dimensional arrays and □?

  • Answer # 1

    It's an array of strings, not an int


    string [,] aaa = new string [,]
                {
                    {"aaa", "bbb", "ccc"},
                    {"ddd", "eee", "fff"},
                    {"ggg", "hhh", "iii"},
                };
                string [] [] ccc = new string [] []
                {
                    new string [] {"aaa", "bbb", "ccc"},
                    new string [] {"ddd", "eee", "fff"},
                    new string [] {"ggg", "hhh", "iii"},
                };


    What is it?
    #Because I was writing, why should I put it?

  • Answer # 2

    How can I declare an array in C #? [email protected]

    Multidimensional Arrays (C # Programming Guide) | Microsoft Docs

    ↑ See here.