What is managed or unmanaged code?

Asked 5 years ago
Viewed 3154 times

0

What is managed or unmanaged code


1 Answer


0

Difference between Managed and Unmanaged code in .NET

The managed code is the code which is managed by the CLR(Common Language Runtime) in DotNet Framework. Whereas the Unmanaged code is the code which is directly executed by the operating system. Here the below are some important differences between the Managed code and Unmanaged code:

What is managed or unmanaged code?

Example :-

static unsafe void Main(string[] args) {

   int var = 20;
   int* p = &var;
   Console.WriteLine("Data is: {0} ", var);
   Console.WriteLine("Address is: {0}", (int)p);
   Console.ReadKey();
}
answered 4 years ago by Shrikant Mishra

Your Answer