Difference between managed C++ and C++

"Managed C++" refers to a language that was included in Visual Studio.NET/Visual Studio.NET 2003. It has since been deprecated, with the latest .NET C++ being C++/CLI.


You can code native C++ two different ways. The first is compiling directly to machine code with just the operating system between you and the platform (hardware). The second native coding is done with MFC (Microsoft Foundation Classes). This is the same as the first example except for the use of MFC.

Managed C++ uses the CLR (Common Language Runtime). The CLR along with the .NET framework class libraries make up the .NET Framework. This managed C++/CLI standard uses the .NET framework along with the CIL (Microsoft Intermediate Language). This standard works by mapping to machine code only when the program is executing by the use of a just in time compiler. If your code will be running on different hardware platforms the use of managed code will be much easier. As with all thing there is a slight price to pay for convenience, as native code will run faster.


When not specified, C++ is unmanaged C++, compiled to machine code. In unmanaged C++ you must manage memory allocation manually.

Managed C++ is a language invented by Microsoft, that compiles to bytecode run by the .NET Framework. It uses mostly the same syntax as C++ (hence the name) but is compiled in the same way as C# or VB.NET; basically only the syntax changes, e.g. using '->' to point to a member of an object (instead of '.' in C#), using '::' for namespaces, etc.

Managed C++ was made to ease transition from classic C++ to the .NET Framework. It is not intended to be used to start new projects (C# is preferred).