On Sunday, 15 May 2022 at 15:59:17 UTC, Alain De Vos wrote:
Can i summarize ,
structs are value-objects which live on the stack.
class instances are reference objects which live on the heap.
the real difference, is that structs, being value types, are
passed by value, and classes, being reference types, are passed
by reference.
this is the most important difference to be aware of.
where they live in memory should be less of the programmers
concern, and more an implementation issue (although some
programmers will of course consider this as well).
btw. where does a struct, inside a class live?