From MSDN

Structs differ from classes in several important ways:

  • Structs are value types (Section 11.3.1).
  • All struct types implicitly inherit from the class System.ValueType (Section 11.3.2).
  • Assignment to a variable of a struct type creates a copy of the value being assigned (Section 11.3.3).
  • The default value of a struct is the value produced by setting all value type fields to their default value and all reference type fields to null (Section 11.3.4).
  • Boxing and unboxing operations are used to convert between a struct type and object (Section 11.3.5).
  • The meaning of this is different for structs (Section 11.3.6).
  • Instance field declarations for a struct are not permitted to include variable initializers (Section 11.3.7).
  • A struct is not permitted to declare a parameterless instance constructor (Section 11.3.8).
  • A struct is not permitted to declare a destructor (Section 11.3.9).
 

相关文章:

  • 2022-01-24
  • 2021-08-09
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-10-06
  • 2021-10-10
猜你喜欢
  • 2021-06-16
  • 2022-12-23
  • 2021-12-15
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案