The concept of "managed" is widely used in the. Net environment, but its meaning varies from place to place:
Managed code:
. The. Net environment provides many core runtime services, such as exception handling and security policies. to use these services, you must provide some information to the runtime environment. Such code is the managed code. all C #, VB. NET, JScript. NET is managed by default. note that VS7 C ++ is not managed! However, the compiler can use the command line option (/com +) to generate the managed code!
Managed Data:
All data managed by managed code is managed data, which passes through. net Automatic garbage processor to manage. however, even if the/com + command line option is used, VS7 C ++ data is not managed and the _ gc keyword must be added to the data.
Managed classes:
It usually refers to the C ++ class under ME (Managed Extensions), and The _ gc keyword is a Managed class. What does this mean?
First, instances of this type are managed by the automatic garbage collector.
Second, in addition to the above, there are also. net benefits and disadvantages. for example, this type can be accessed through interaction with other languages. For example, me c ++ can be inherited from the VB class. this is the benefit. however, managed classes can only inherit from one base class, which is a disadvantage.