title: What is the correct way to memset an array of pointers?
body: <p>If I have pointers of type <code>T (T*)</code> and I have an array of them <code>T* array[N]</code> will these two methods allow me to later check which entries are null pointers to lazily initialize stuff in each bucket?</p>
  
  <p><code>memset(array, 0, sizeof(T*)*N);</code></p>
  
  <p>or</p>
  
  <pre><code>for (int i = 0; i &lt; N; ++i)
      array[i] = NULL;
  </code></pre>
  
  <p>i.e. will the <code>memset</code> call also let me later do <code>if (array[i] == NULL) ...</code>?</p>
  
  <p>I wouldn't want to introduce undefined behavior if not..</p>