_yer必须声明为int?或Nullable
int? _yer; int _ner; public MyStruct(int? ver, int ner) { _yer = ver; _ner = ner; } }
或者像这样:
Nullable_yer; int _ner; public MyStruct(Nullable ver, int ner) { _yer = ver; _ner = ner; } }
请记住,结构不能包含显式无参数构造函数.
error CS0568: Structs cannot contain explicit parameterless constructors