Are you sure you want to delete this flashcard?

CSharp

What is the difference between a struct and a class in C#?

A struct is a value type stored on the stack, while a class is a reference type stored on the heap. Structs are generally faster for small, simple data structures due to stack allocation, while classes are more efficient for larger, complex objects.

1

https://www.geeksforgeeks.org/difference-between-class-and-structure-in-c-sharp/

0

Cancel