native code Managed and unmanaged code can be mixed together in the same CLI assembly seamlessly. This allows the programmer to keep unmanaged code that cannot be ported over to the .NET Framework without re-writing it completely. Some ramifications of using this hybrid convention are present though. Managed C++ is the only language that can contain unmanaged code and natively communicate with all other .NET languages. Managed C++ is thus very convenient for interoperability between programmers who use different languages, including those in the .NET theater and those who use standard C++. Disadvantages compared to unmanaged code Managed C++ introduces a lot of new keywords and syntactic conventions that can impair the readability of code, especially if C++ code is included directly and interacts directly with Managed C++ code in the same assembly. Managed C++ is superseded by C++/CLI and thus obsolete as C++/CLI has been standardized. Disadvantages compared to fully managed code Managed C++ requires a slightly longer development time than other .NET languages that could be applied to projects that still produce the same results. The use of pointers may or may not be a requirement, because managed C++ has both value types (__value struct and __value class) and reference types (__gc struct and __gc class). Managed C++ fully support ASP.NET web applications, even though the development is more difficult than with other .NET languages, including some other third party languages. Managed C++ includes only support for templates (for interoperability with native C++) but no support for generics (for interoperability with all the other .NET languages). C++/CLI supports both templates (at compile time) and generics (at run time). Examples The following examples depict the use of Managed C++ as compared to standard C++: (Global change) Existing C++ to be ported over the CLR must be appended with the following: //hello.cpp //new using directive #using <mscorlib.dll> //another using namespace directive. using namespace System; int main() { Console::WriteLine("Hello, world!"); return 0; } A new preprocessor directive #using <mscorlib.dll> is required. In addition to that, more #using directives are required to import more libraries to use more namespaces in the Base Class Library, such as #using <System.Windows.Forms.dll> and using namespace System::Windows::Forms; to use Windows Forms. To compile code to target the CLR, a new compiler option must be introduced. cl.exe hello.cpp /clr /clr enables any code referencing the .NET Framework to be compiled as CIL. A class can be designated to