title: C++ two dimensional arrays with pointers
body: <p>I have a problem with two dimensional arrays :( I feel very stupid and Visual C does not help me :( and I also think that my mistake is very stupid but still I can't find it :( I have this code:</p>
  
  <pre><code>double matrix[100][100]; //which is full with a matrix 3x4
  double nVector[10000]; // for negative doubles
  //I wanted to see if there are negative doubles in each row and column 
  //and I want this to happen with function
  </code></pre>
  
  <p>And this is my function:</p>
  
  <pre><code>double* negativeVector(double*nVector, double*fromVector, int m, int n){
      int position = 0;
  
      double *myNegArray = nVector;
      double *myMatrix = fromVector;
  
      for(int i = 0; i &lt; m*n; i++)
          if(*(*(myMatrix+i)) &lt; 0){
              *(myNegArray+position) = *(*(myMatrix+i));
              position++;
          }
  
      return myNegArray;
  }
  
  //for double*nVector I'm passing nVector
  //for double*fromVector I'm passing *matrix
  </code></pre>
  
  <p>Visual C tells me that I have an error C2100: illegal indirection here: <code>*(*(myMatrix+i))</code> I hope someone can help me (happy)</p>
  
  <p>Thanks in advance!</p>