Web Development

Deep copy in C#

Deep Copy: A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. To make a deep copy, you must use IClonable Interface. // Program: Deep Copy // Purpose: Training period // By: H.M. Saiful Islam using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DeepCopy { class… Continue reading Deep copy in C#

Web Development

Shallow copy in C#

Shallow Copy: A shallow copy of an object copies all of the member field values. This works well if the fields are values, but may not be what you want for fields that point to dynamically allocated memory. The pointer will be copied. but the memory it points to will not be copied — the… Continue reading Shallow copy in C#