title: C# Pointer to object?
body: <p>I need to 'copy' an object. I tried using the IClonable interface, with no avail and the most sensable solution to me is to use unsafe code to create a pointer to the object and then write a method like Memcpy in C. The only problem is creating a pointer to a managed type. I am assuming that doing such will bring issues with the garbage collector, but if it is possible to use marshaling or something to create a pointer to a managed object then I could write a function like memcpy in C and just copy my object. If structs can be unmanaged then why can't objects? An object is essentially a struct pointer so in theory it should be equal to size of an IntPtr right? </p>