Sign in to follow this  
sdlprorammer

[.net] c++.net

Recommended Posts

i have a question. what's the difference betweem c++ an c++.net?? i know .net is the compiler and c++ the language, but what's so special about it? does it support any more functions for windows?? what's so cool about it? exept from having a very good compiler does it have anything more? thank you all in advance

Share this post


Link to post
Share on other sites
Visual C++.net 2002 is the follow up to VC6
VC++.net 2002 <-> VC++ 7
VC++.net 2003 <-> VC++ 7.1
VC++.net 2005 <-> VC++ 8

There are however C++ bindings for the .NET runtime, which is basically a multi-language Virtual Machine (think Java), the 2002 compiler was the first to support them.

Share this post


Link to post
Share on other sites
The .NET compilers conform to the ISO C++98 standard better than previous versions of Visual C++, and they let you write Managed C++ programs (C++ programs that use features of the .NET platform). Of course you can still write unmanaged code, and enjoy all the benefits of the more ISO-compliant compiler.

Share this post


Link to post
Share on other sites
> they let you write Managed C++ programs (C++ programs that use features of the .NET platform).

:) that's what i am looking for! so what are these features and about what?

thanks

Share this post


Link to post
Share on other sites
This provides a nice introduction to Managed C++. Basically MC++ won't compile to native code, but to IL (intermediate language), common to all .NET languages (such as VB.NET, C# and Java#). You will also get some extensions, a fully optimising compiler backend (the only .NET compiler that features this) as well as access to the whole .NET framework library.
MSDN contains a migration guide, which decibes MC++ features more in-depth.

Share this post


Link to post
Share on other sites
yeah thank you! so if i understand, c++.NET is a completely different language than C++ right? but why would you want to learn C++.NET ( if you have Visual Studio.NET) and not just the standard c++?

Share this post


Link to post
Share on other sites
The next version of Managed C++, called C++/CLR, is almost a complete rewrite from the current version. Check out this article at MSDN for an overview of the new features. There's also an artice that explains the changes in STL.NET that allow the STL functions to be used with .NET library types. The C++ standard STL is still fully available, of course. All of the .NET stuff is completely seperate and optional.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Johnny Watson
The .NET compilers conform to the ISO C++98 standard better than previous versions of Visual C++


Definitely true, but remember that this is really true only from VC++ 7.1 onward--Visual Studio .NET 2003 was the edition where the C++ compiler was really reworked to improve standard compliance.

Share this post


Link to post
Share on other sites
The reason for Managed C++ is so that you can take your existing C++ code and convert it to the .NET platform very quickly. This lets you use the features of the .NET framework immediatly, without re-writing everything in C#.

If you're not porting existing C++ to the .NET framework, then program with C# (if you have a compiler available).

If you're not using .NET framwork features, then use unmanaged C++.

Microsoft Visual C++ .NET will compile both unmanaged an managed C++ (what you refer to in your post as C++ and C++.NET respectivly).

Share this post


Link to post
Share on other sites
Quote:
The reason for Managed C++ is so that you can take your existing C++ code and convert it to the .NET platform very quickly.

I totally concur with Andrew and just want to add that MC++ is the fastest way to interoperate between managed and unmanaged code -- much faster than P/Invoke and COM interop.

Put it another way: Let's say you have an existing code base, let's call it DirectX for the sake of argument, and you want to make it available to C#, VB.Net, and other managed programmers. Which language should you choose for the interface layer? Managed C++.

(Unless you want to run on Mono... [grin].)

Share this post


Link to post
Share on other sites
Something like that.

You can basicly compile anyting to MSIL (Microsoft Intermediate Language) bytecode that runs on the .NET framwork (like how Java compiles to bytecode that runs in the Java Runtime Environment).

Microsoft have simply chosen to provide compilers that output MSIL for all the languages that they support. This is good because it means that VB, C#, C++, etc can all interoperate.

Other languages can also compile to MSIL. I know that there is a Python.NET project somewhere.

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