← BYTES
C#·Starter·Ref: 22.1.14

What's the key difference between a class and a struct regarding assignment?

Have a question about this video? Mention reference 22.1.14 when you contact us.

a.There is no difference
b.Structs can never have methods
c.Assigning a class variable copies a reference; assigning a struct variable copies the whole value
d.Classes are always faster
Classes are reference types (assignment copies the reference, both variables point to the same object); structs are value types (assignment copies the data itself).

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES22114#C