title: Explicit Address Manipulation in C++
body: <p>Please check out the following func and its output </p>
  
  <pre><code>void main()
  {
      Distance d1;
      d1.setFeet(256);
      d1.setInches(2.2);
  
      char *p=(char *)&amp;d1;
      *p=1;
  
      cout&lt;&lt; d1.getFeet()&lt;&lt; " "&lt;&lt; d1.getInches()&lt;&lt; endl;
  }
  </code></pre>
  
  <p>The class <code>Distance</code> gets its values thru <code>setFeet</code> and <code>setInches</code>, passing <code>int</code> and <code>float</code> arguments respectively. It displays the values through through the <code>getFeet</code> and <code>getInches</code> methods.</p>
  
  <p>However, the output of this function is <code>257 2.2</code>. Why am I getting these values?</p>