What is marshalling and why do we need it?

Technology CommunityCategory: C#What is marshalling and why do we need it?
VietMX Staff asked 3 years ago

Because different languages and environments have different calling conventions, different layout conventions, different sizes of primitives (cf. char in C# and char in C), different object creation/destruction conventions, and different design guidelines. You need a way to get the stuff out of managed land an into somewhere where unmanaged land can see and understand it and vice versa. That’s what marshalling is for.