2d arrays to method's

I've been trying to send a 2d array to a method.  I managed to find out about the params keyword but this seems to only be ablt to work with 1 dimentional arrays.  Any ideas


Answer this question

2d arrays to method's

  • Ian Espiga



    private void Form1_Load(object sender, System.EventArgs e)

    {

       int[,] arr = new int[10,10];

       SomeFunc(arr);

       MessageBox.Show(arr[0,0].ToString());

    }

    private void SomeFunc(int[,] arr)

    {

       arr[0,0] = 10;

    }


     


  • Srock

    TYVM thats what i get for thinking it's going to be more complicated than it actually is.  Turns out it's quite obvious lol.  again thx alot

  • 2d arrays to method's