Looking at this Microsoft article How to: Write a Copy Constructor (C#) and also this Generic C# Copy Constructor, wouldn't it be best/safe to use a reference to the class instance than to use a plain copy of the instance ?
public class Myclass() { private int[] row; public MyClass(ref MyClass @class) { for(int i = 0; i<@class.row.Length;i++) { this.row[i] = @class.row[i]; } } }
@. Edited, but not advisable.refkeyword actually means, especially when used in conjunction with reference types.MyClass) are always passed by reference.refmeans you are passing a reference to the variable, so if you were to change@classto point to a differentMyClass, the caller would see that happen to whatever variable they passed in.refisn't permitted (properties, anonymous methods, etc.)