- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is a managed code in C#?
Managed code is a code whose execution is managed by Common Language Runtime. It gets the managed code and compiles it into machine code. After that, the code is executed.
The runtime here i.e. CLR provides automatic memory management, type safety, etc.
Managed code is written in high-level languages run on top of .NET. This can be C#, F#, etc. A code compiled in any of this language with their compilers, a machine code is not generated. However, you will get the Intermediate Language code, compiled and executed by runtime.
C/C++ code, called "unmanaged code” do not have that privilege. The program is in binary that is loaded by the operating system into the memory. Rest, the programmer has to take care of.
C++ can also produce unmanaged binaries that run on Windows.
C# allows unmanaged constructs like pointers directly in code using unsafe context. It sets a piece of code for which the execution is not managed by the CLR.
- Related Articles
- Managed code vs Unmanaged code in C#
- Difference between Managed and Unmanaged code in .NET
- What is unmanaged code in C#?
- What is unsafe/unmanaged code in C#?
- What is an "Account in Trust" or "Trust Account" and how is it managed?
- Check if a thread belongs to managed thread pool or not in C#
- What is Polynomial Code?
- Getting the unique identifier for the current managed thread in C#
- What is Gray code?\n
- What is Code Division Multiplexing?
- What is Intermediate Code Generation?
- What is Three Address Code?
- Difference between a Managed and an Unmanaged Switch
- What are hardware and software resources managed by the OS?
- What is Excess-3 Code?\n
