title: How do I "reset" a buffer?
body: <p>Say I create a member variable pointer <code>pBuffer</code>.  I send this buffer into some unknown land to be filled with data.  Now say pBuffer has an arbitrary amount of data in it.  </p>
  
  <p>Q: <em>Is there a way to reset pBuffer without completely deleting it, while still deallocating all unnecessary memory it was occupying?</em></p>
  
  <p>Example:</p>
  
  <pre><code>class Blah
  {
  public:
  
      unsigned char* pBuffer;
  
      Blah(){pBuffer = NULL;}
      ~Blah(){}
  
      FillBuffer()
      {
          //fill the buffer with data, doesn't matter how
      }
  
      ResetBuffer()
      {
          //????? reset the buffer without deleting it, still deallocate memory ?????
      }
  
  };
  
  int main()
  {
      Blah b;
      b.FillBuffer();
      b.ResetBuffer();
      b.FillBuffer(); //if pBuffer were deleted, this wouldn't work
  }
  </code></pre>