title: Stack variables vs. Heap variables
body: <p>Am I correct in thinking that:</p>
  
  <pre><code>char *buff[500];
  </code></pre>
  
  <p>... creates a stack variable, and:</p>
  
  <pre><code>char *buff = (char *)malloc(500);
  </code></pre>
  
  <p>... creates a heap variable?</p>
  
  <p>If that's correct, when and why would you use heap variables over stack variables and vice versa. I understand the stack is faster is there anything else.</p>
  
  <p>One last question, is the main function a stack frame on the stack?</p>