What is managed code in C#?

WBOY
Release: 2023-09-07 10:53:02
forward
1429 people have browsed it

C# 中的托管代码是什么?

Managed code is code that is managed and executed by the common language runtime (CLR). It takes managed code and compiles it into machine code. After that, the code is executed.

The runtime here is the CLR, which provides automatic memory management, type safety and other functions.

Managed code is written in a high-level language and runs on .NET. It can be C#, F#, etc. Code compiled using their compiler does not produce machine code. However, you will get intermediate language code, compiled and executed by the runtime.

C/C code is called "unmanaged code" and it does not have this privilege. It is the responsibility of the operating system to load programs into memory in binary form. Programmers need to handle the rest themselves.

C It is also possible to generate unmanaged binaries that run on Windows.

C# allows the use of unmanaged constructs of unsafe contexts directly in code, which sets up a section of code that is not managed by the CLR.

The above is the detailed content of What is managed code in C#?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template