C# memcpy equivalent

后端 未结 8 658
野的像风
野的像风 2020-12-11 05:11

I have 2 objects from the same type and i would like to shallow copy one state to the other. In C++ i have memcpy which is great. How can i do it in C#? The MemberwiseClone(

8条回答
  •  感动是毒
    2020-12-11 05:35

    When i think about it - it's very interesting to look at the code of the MemberWiseClone() method implementation and see how Microsoft solved my question.

提交回复
热议问题