Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# 中的自定义值类型是什么?我怎样才能创建它们?
要创建一个值类型,您需要将您的类型定义为 a struct(而不是 a class,它定义了一个引用类型)。例如:
struct
class
struct MyValueType { public string MyField; }