title: Investigating why a pointer turns bad (C++)
body: <p>A piece of C++ code I am looking into in VS 2008 has a bad pointer. The pointer is initialized properly and has very few lines of code referencing it. I put a watch on this pointer while debugging.</p>
  
  <p>When a certain method is called, the value of the pointer suddenly changes from <b> 0x05fe0040 "" </b> to <b>0x00000000 Bad Ptr </b> (in the Watch window of VS2008). I can't seen to figure out why this is happening. There are no operations on the pointer between the lines of code where it loses its value. </p>
  
  <p>How do I investigate this further? What are some possible reasons why this pointer has turned bad?</p>
  
  <p>I am new to C++ programming and am using VS2008 for the first time, so please explain anything you think is pertinent.</p>