- structs
- created on the stack
- not polymorphic
- memory efficient
- not inheritable
- used mostly for data storage
- classes
- created references on the heap
- polymorphic
- inheritable
- define behavior
Use structs for simple objects that are just data containers.
Use classes for any objects that perform work.
No comments:
Post a Comment