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.

But that's not entirely true as you can allocate a struct on the heap as well.

The real difference is inheritance and polymorphism, not allocation and where the memory lives.

Reply via email to