title: C stack with arrays
body: <p>I am trying to store arrays in a stack;</p>
  
  <pre><code>int *orderStack[2];
  int orderSize=2;
  int orderTop=0;
  
  void pushOrder(int newOrder[2]) {
  
  
      if(orderTop&gt;=orderSize) {
          int i;
          int *stack2 = (int*) malloc(sizeof(int)*orderSize*2);
          for(i=0; i&lt;orderSize; i++) {
              stack2[i] = orderStack[i];
          }
  
          orderStack = stack2;
          orderSize *= 2;
      }
  
  
      orderStack[numberTop][0] = newOrder[0];
      orderStack[numberTop++][0] = newOrder[1];
  
  
      int temp, i, j, k;
  
      for (j = 0; j &lt; numberTop; ++j) {
          for (k = j + 1; k &lt; numberTop; ++k) {
              if (orderStack[j][1] &gt; orderStack[k][1]) {
                  temp = orderStack[j][1];
                  orderStack[j][1] = orderStack[k][1];
                  orderStack[k][1] = temp;
              }
         }
     }
  }
  </code></pre>
  
  <p>But this it gives this error: [Error] assignment to expression with array type for the line </p>
  
  <pre><code>orderStack = stack2;
  </code></pre>
  
  <p>I read more then 20 questions about this error, arrays and stacks but I could not find what am I doing wrong.</p>