Structs vs Classes

  • Structs are value types and classes are reference types
  • Structs consume less heap memory

When to use a struct?

  • When there’s going to be lots of them
  • When they’re going to be small, 16 bytes or less
  • They won’t need to change

 

Reference