Inherit from struct

前端 未结 7 949
小蘑菇
小蘑菇 2020-12-16 13:07

I am try to figure out what is the problem whit my code. I have this code:

public struct MyStructA
{
    public MyStructA(string str)
    {
        myString=         


        
7条回答
  •  被撕碎了的回忆
    2020-12-16 13:20

    Structs can implement an interface but they cannot inherit from another struct. For that reason, struct members cannot be declared as protected.

提交回复
热议问题