title: How is the memory layout of a class vs. a struct
body: <p>I come from C programming where the data in a struct is laid out with the top variable first, then the second, third and so on..</p>
  
  <p>I am now programming in C++ and I am using a class instead. I basically want to achieve the same, but I also want get/set methods and also maybe other methods (I also want to try do it in a C++ style and maye learn something new).</p>
  
  <p>Is there a guarantee e.g. that the public variables will be first in memory then the private variable?</p>