C# memcpy equivalent

后端 未结 8 640
野的像风
野的像风 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.

    0 讨论(0)
  • 2020-12-11 05:39

    I cannot use a newly created object because i like the template object to be changed according to the state of one of its instances (i.e instance made of that template)

    0 讨论(0)
提交回复
热议问题