What are the differences between a class and a struct?

Structs:

  • struct are pass by value structures
  • suitable for smaller structures
  • stored in the Stack

Class:

  • classes are pass by reference structures
  • suitable for storing larger structures and types
  • stored in the heap

Structs:

  • struct are pass by value structures
  • suitable for smaller structures
  • stored in the Stack

Class:

  • classes are pass by reference structures
  • suitable for storing larger structures and types
  • stored in the heap
Default image
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply