title: Finding NULL pointers in std vectors
body: <p>I'm working with vectors and at some point there will be NULL entries; I want to erase all NULL occurrences within the given vectors. My approach so far is not working:</p>
  
  <pre><code>for(int i = sent_flit_list-&gt;size() - 1; i &gt;= 0; i--)
  if(sent_flit_list[i] == NULL)
      sent_flit_list-&gt;erase(sent_flit_list[i]);
  
  for(int i = sent_pkt_list-&gt;size() - 1; i &gt;= 0; i--)
  if(sent_pkt_list[i] == NULL)
      sent_pkt_list-&gt;erase(sent_pkt_list[i]);
  </code></pre>
  
  <p>Where </p>
  
  <pre><code>vector&lt;Flit*&gt; *sent_flit_list;
  vector&lt;Packet*&gt; *sent_pkt_list;
  </code></pre>
  
  <p>are the vectors. I have tried casting to a type (Flit*)NULL/(Flit*)0 but with no success.</p>
  
  <p>Any help will be greatly appreciated.</p>