Managed or Unmanaged C++?

Started by
1 comment, last by dnsauve 17 years, 5 months ago
I have always known the two types of C++ were out there. Just never really been curious about the difference until now when I have started working with DirectX and realized there was a different help section for either one. I think I have a basic idea about it, with unmanaged C++ you have to manually free up memory locations on the heap, but not sure of any other differences. So my question is are there any other difference, like does performance differ significantly? Also I know the .net framework C and C++ is managed, is there another Microsoft C++ compiler that is unmanged that I am missing?
Advertisement
There is only one type of C++ and that's C++. Managed C++ (or, C++/CLI) is a Microsoft invention to allow C++ style code to work with the .Net framework and the managed runtime environment. There's a whole bunch of new key words added to the language: for each, gcnew, ref class, enum class, value class, interface class, abstract, override, property, event, delegate and so on. Yes, there are two word keywords (which upset some C++ people).

As for the compiler, the MS VC compiler can produce either IA32 (native) code or MSIL (managed) code depending on the options used.

The .Net framework is just a set of libraries, a bit like Java packages.

Skizz
Managed C++, unlike C++, doesn't compile to native code. Instead, it compiles to an intermediate format that is run using .NET.

It's actually pretty nice to work with, I found. I was able to create a small application that downloaded weather data from an FTP server and converted it to XML using the built XML serialisation routines in .NET.

Plus the built in support for regular expression is great.

Basically, it allows you to use .NET in a C++ like language.

This topic is closed to new replies.

Advertisement