title: Not all code routes produce a value, with a procedure I am sure it produces always something. C#
body: <p>I am working in C# with a procedure that has an array of structs M as an input and has to get a 2x2 table with some calculations. TablaContingencia's size is 2x2 (impossible to have a bigger size).</p>
  
  <p>With <em>int[,] TablaContingencia = new int[2, 2];</em> I get "not all code routes obtain a value"
  With  <em>int[,] TablaContingencia = new int[1, 1] {{0,0},{0,0}};</em> I get "Expected a matriz initialization with length 1".</p>
  
  <p>Help!</p>
  
  <pre><code>        public static int[,] TablaContingencia(MAnalitica[] M)
      {
          int[,] TablaContingencia = new int[2, 2]; //Inicializes with size 2x2
          int categ = M.GetLength(0);
          for (int m = 0; m &lt;= categ - 1; m = m + 1)
          {
              int k = M[m].P;
              int Pr0 = Convert.ToInt16(M[m].Conteo * (1 - M[m].PCliente));
              int Pr1 = Convert.ToInt16(M[m].Conteo * M[m].PCliente);
              TablaContingencia[k, 0] = TablaContingencia[k, 0] + Pr0;
              TablaContingencia[k, 1] = TablaContingencia[k, 1] + Pr1;
  
          }
      }
  </code></pre>