Does object store variables sequentially?
<p>Could you use a pointer over class member variables to increment or decrement over any variable? Or why not?</p>

<p>For example, a struct or class</p>

<pre><code>struct MyStruct {
   int x;
   int y;
   int z;
};

int main()
{
   MyStruct Obj;
   int *p = &amp;Obj.x;

   cout &lt;&lt; *p &lt;&lt; endl;
   cout &lt;&lt; p++ &lt;&lt; endl;
   cout &lt;&lt; p++ &lt;&lt; endl;
}
</code></pre>

<p>I also noted the address of Obj and its variable is same.</p>
