What’s the difference between struct and class in C#?
By in C# on Jul 14 2006
  • paresh nawale
    Oct, 2008 29

    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

    • 0
  • Jul, 2006 14

    Structs cannot be inherited.

    Structs are passed by value, not by reference.

    Struct is stored on the stack, not the heap.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS