In visual c++ you have a choice to create a managed class or an unmanaged class. The differences between managed code and unmanaged code are that unmanaged code is compiled directly to native machine code (otherwise known as native code), while managed code is compiled to a secondary language which is then compiled and ran on run-time.
In C# or Visual Basic, you don't have a choice; Your code is always compiled into the standard IL language. In Visual c++ you have a choice. In fact you can even do this per-class simply by defining your classes with "__gc ". An example would be my class known as "Player_Class":
Unmanaged
Code: Select all
class player_class
{
private:
int x, y, z;
}
Managed
Code: Select all
__gc class player_class
{
private:
int x, y, z;
}
which in actual terms mean "Garbage Collected". That is how you define managed code from unmanaged code. Please keep in mind that your project must then compile under CLR instead of into native machine code.
You can
technically used managed code together with unmanaged code, however that gets complicated. I will not get into details about that (although i'm sure a simple google search will provide you with more than enough information concerning that)