title: C subscripted value is neither array nor pointer nor vector when assigning an array element value
body: <p>Sorry for asking the already answered question, I am a newbie to C and don't understand the solutions.
  Here is my function</p>
  
  <pre><code>int rotateArr(int *arr) {
      int D[4][4];
      int i = 0, n =0;
      for(i; i &lt; M; i ++ ){
          for(n; n &lt; N; n++){
              D[i][n] = arr[n][M - i + 1];
          }
      }
      return D;
  }
  </code></pre>
  
  <p>It throws an error </p>
  
  <blockquote>
    <p>main.c|23|error: subscripted value is neither array nor
    pointer nor vector|</p>
  </blockquote>
  
  <p>on line </p>
  
  <blockquote>
    <p>D[i][n] = arr[n][M - i + 1];</p>
  </blockquote>
  
  <p>What's wrong? I am just setting the value of an array element to another array element.</p>
  
  <p>The arr passed is declared as</p>
  
  <pre><code>int S[4][4] = { { 1, 4, 10, 3 }, { 0, 6, 3, 8 }, { 7, 10 ,8, 5 },  { 9, 5, 11, 2}  };
  </code></pre>