2
Reply

What’s the difference between struct and class in C#?

18y
19.4k
0
Reply

    Missing differences:

    1) You cannot have instance Field initializers in structs.But classes can have
    2) Classes can have explicit parameterless constructors. But structs cannot have explicit parameterless constructors.

    3)Classes must be instantiated using the new operator. But structs can be

    please check following article from dhyanchand.a.v. on struct and class differences.

    http://www.dotnetspider.com/resources/740-Difference-between-class-struct-C.aspx

    Structs cannot be inherited.

    Structs are passed by value, not by reference.

    Struct is stored on the stack, not the heap.

    18y
    0