title: zeroing out memory
body: <p>gcc 4.4.4 C89</p>
  
  <p>I am just wondering what most C programmers do when they want to zero out memory.</p>
  
  <p>For example, I have a buffer of 1024 bytes. Sometimes I do this:</p>
  
  <pre><code>char buffer[1024] = {0};
  </code></pre>
  
  <p>Which will zero all bytes.</p>
  
  <p>However, should I declare it like this and use memset?</p>
  
  <pre><code>char buffer[1024];
  .
  .
  memset(buffer, 0, sizeof(buffer));
  </code></pre>
  
  <p>Is there any real reason you have to zero the memory? What is the worst that can happen by not doing it?</p>