Sign in to follow this  
Riya

Managed or Unmanaged C++?

Recommended Posts

Riya    116
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?

Share this post


Link to post
Share on other sites
Skizz    794
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

Share this post


Link to post
Share on other sites
dnsauve    181
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this