title: Extract the bit stream (0 and 1) of an object
body: <p>I need to get the bits of an object. In other words I want to treat an object as a raw data and extract the 0 and 1 bits of it. How can I do this?</p>
  
  <p>For example I have a vector of a user-defined type called <strong>vec</strong> as following,</p>
  
  <pre><code>std::vector&lt;NodeEntry *&gt; vec;
  </code></pre>
  
  <p><strong>vec</strong> points to an object. This object is in memory and consists of 0 and 1 bits. How can I extract the bit stream (0 and 1) of this object.</p>