What is managed code and managed data?

Managed code is code that is written to target the services of the Common Language Runtime. In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data--data that is allocated and de- allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that it brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class.

Showing Answers 1 - 8 of 8 Answers

Ans:

1.Managed code is code that is written to target the services of the Common Language Runtime.

2. In order to target these services, the code must provide a minimum level of information (metadata) to the runtime

sunileswar behera

  • Jul 19th, 2006
 

The code which is under the control of CLR is call managed code , and the code which is not under the control of CLR is called unmanaged code.

  Was this answer useful?  Yes

swaroop

  • Oct 29th, 2011
 

The code which targets clr while execution is called as managed code and the code which takes operating system help while execution is called as unmanaged code

  Was this answer useful?  Yes

Ashok chowdary

  • Jun 7th, 2012
 

The code which is executed under the control of dotnet frame work which called as managed code

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions