0% found this document useful (0 votes)
36 views1 page

C# ManagementCode Advance

Managed code is generated by the .NET compiler and runs on the CLR, providing benefits like garbage collection and type safety, while unmanaged code is compiled to native machine code and executed directly by the operating system. Developers of unmanaged code must manually handle memory management and exceptions. Managed code is typically written in languages like Visual Basic and C#, whereas unmanaged code is often written in C or C++.

Uploaded by

sanam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

C# ManagementCode Advance

Managed code is generated by the .NET compiler and runs on the CLR, providing benefits like garbage collection and type safety, while unmanaged code is compiled to native machine code and executed directly by the operating system. Developers of unmanaged code must manually handle memory management and exceptions. Managed code is typically written in languages like Visual Basic and C#, whereas unmanaged code is often written in C or C++.

Uploaded by

sanam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Explain the difference between managed and unmanaged code.

‍ MANAGED CODE is a code created by the .NET compiler. It does not depend on the
architecture of the target machine because it is executed by the CLR (Common
Language Runtime), and not by the operating system itself. CLR and managed code
offers developers few benefits, like garbage collection, type checking and
exceptions handling.

On the other hand, UMANAGED CODE is directly compiled to native machine code and
depends on the architecture of the target machine. It is executed directly by the
operating system. In the unmanaged code, the developer has to make sure he is
dealing with memory usage and allocation (especially because of memory leaks), type
safety and exceptions manually. In .NET, Visual Basic and C# compiler creates
managed code. To get unmanaged code, the application has to be written in C or C++

You might also like