C++: error: invalid types ‘size_t {aka long unsigned int}[size_t {aka long unsigned int}]’ for array subscript
<p>I get the following error when compiling: <code>error: invalid types ‘size_t {aka long unsigned int}[size_t {aka long unsigned int}]’ for array subscript interactionMatrix[i][k]=interaction;</code></p>

<p>Here ist the code:</p>

<pre><code>void Tree::computeInteractionScore(size_t* interactionMatrix){
  size_t num_independent_variables = data-&gt;getNumCols() - no_split_variables-&gt;size();

  for (size_t i = 0; i &lt; num_independent_variables; ++i) {
    for (size_t k = 0; i &lt; num_independent_variables; ++k) {
      size_t interaction = 0;
      if(k!=i){
      //  interaction = computeInteraction(i,k);
      }
      interactionMatrix[i][k]=interaction;
    }
  }
}
</code></pre>

<p>interactionMatrix is declared as follow:</p>

<pre><code>  size_t num_independent_variables = data-&gt;getNumCols() - no_split_variables-&gt;size();

  size_t interactionMatrix[num_independent_variables][num_independent_variables];

  for (size_t i = 0; i &lt; num_trees; ++i) {
    trees[i]-&gt;computeInteractionScore(&amp;interactionMatrix);
  }
</code></pre>