InterviewSolution
| 1. |
What is the difference between managed and unmanaged code? |
|
Answer» Managed Code: Managed Code is the code which isn’t run by the operating system directly. It is implemented in the run time environment. There are many benefits of Managed runtime such as type checking, garbage collection, bound checking, exception HANDLING, etc. without the need for interference from the programmer. The compiler compiles the code in the .Net framework and TRANSLATES into an intermediate language, MSIL. It is then translated to executable code. Unmanaged Code: Unmanaged code is not translated to executable code. It directly RUNS on the operating system. On every platform an unmanaged code runs, it is compiled separately. The reason is that it depends on the architecture of the system. Since it is compiled into a to native code, it can lead to many problems such as POINTER override, buffer OVERFLOW, memory leak, etc. Unmanaged code provides direct access to the hardware and is not 100% secure to create applications. |
|