What is the difference between Managed C++ and C++/CLI?

你离开我真会死。 提交于 2019-12-18 12:07:23

问题


What is exactly the difference between the "old" Managed C++ and the "new" C++/CLI?


回答1:


Managed C++ is the version in VS2002 and VS2003. It had race conditions and other serious bugs, as well as being confusing. It's no longer supported.

In VS2005, Microsoft introduced C++/CLI, which has also been accepted as an ISO standard. It's also supported in VS2008 and the upcoming VS2010.

Both of them had the same goal, which is to create .NET assemblies using the C++ language. The syntax is different (C++/CLI managed code is a lot easier to differentiate from standard C++ at a glance) and C++/CLI also has syntax for .NET 2.0 features such as generics.




回答2:


http://msdn.microsoft.com/en-us/library/ms235298.aspx gives a rough overview of the syntax changes.




回答3:


Managed C++ (Managed Extensions for C++) is a set of microsoft specific keywords used with standard C++ syntax to allow compile managed code. IT was designed such that programmers could start using .NET as fast as possible and made porting native code to .NET platform very easy. It used IJW (it just works) priciple, which made programming porting to .NET easier, but it also had lot of flaws.

C++/CLI is a new language. It solved lot of problems of Managed C++, made .NET programming more powerful and is accepted as standard, but also introduces new syntax, new keywords, and is more more different from unmanaged C++ than older Managed C++.



来源:https://stackoverflow.com/questions/2443811/what-is-the-difference-between-managed-c-and-c-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!