title: what part of memory are array allocated in c
body: <p>In c, when you declare an array like <code>int buffans[46];</code>, what part of memory is this created in? </p>
  
  <p>The reason I'm asking is because my mcu appears to hanging when I get to this part of the code, but when I use a smaller array <code>int buffans[26];</code> it works ok. </p>
  
  <p>I'm wondering if I am running out of memory? </p>
  
  <pre><code>void getRes(int length){
    int i;
    int buff[46];
    for (i = 0; i &lt; length; i++)
    {
      buff[i] = getch(UART_7)); 
    }
    buff[i] = 0;
    TI_PRINTF("\nANS ");
    for( i = 0; i &lt; length; i++)
    {
      TI_PRINTF("[%x]", buff[i]);
    }
    TI_PRINTF("\n");
  }
  </code></pre>