What is meant by Unmanaged or Managed Code? | C# interview Questions 16

Managed Code refers to code that runs under the management of a runtime environment, such as the Common Language Runtime (CLR) in .NET. The CLR handles various aspects of execution, including memory management (garbage collection), security, exception handling, and cross-language integration. Examples include C# and VB.NET code.

Unmanaged Code refers to code that runs directly on the operating system, outside the control of a runtime environment. This means the programmer is responsible for manual memory management, error handling, and other low-level tasks. Examples include C and C++ code. Unmanaged code can lead to higher performance but requires careful handling to avoid issues like memory leaks and security vulnerabilities.

Leave a Reply

Your email address will not be published. Required fields are marked *