title: I need to create 2D array in C#
body: <p>I need to create 2D jagged array. Think of a matrix. The number of rows is known, the number of columns is not known. For example I need to create array of 10 elements, where type of each element string[]. Why do I need that? The number of columns is not known - this function must simply do the allocation and pass array to some other function. </p>
  
  <pre><code>string[][] CreateMatrix(int numRows)
  {
   // this function must create string[][] where numRows is the first dimension.
  }
  </code></pre>
  
  <p>UPDATE</p>
  
  <p>I have C++ background. In C++ I would write the following (nevermind the syntax)</p>
  
  <pre><code>double ** CreateArray()
  {
   double **pArray = new *double[10]() // create 10 rows first
  }
  </code></pre>
  
  <p>UPDATE 2</p>
  
  <p>I was considering using List, but I need to have indexed-access to both rows and columns.</p>