托管c ++和c ++之间的区别 [英] Difference between managed c++ and c++

查看:147
本文介绍了托管c ++和c ++之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主题标题实际上是我的问题。第二个问题是:什么时候使用这两个?

The topics title is actually my question. And the second question is: When do I use what of these two?

推荐答案

当没有指定时,C ++是非托管C ++,到机器代码。在非托管C ++中,您必须手动管理内存分配。

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

托管C ++是由Microsoft发明的一种语言,它编译为由.NET Framework运行的字节码。它使用与C ++(因此名称)相同的语法,但是以与C#或VB.NET相同的方式编译;基本上只有语法改变,例如使用' - >'指向一个对象的成员(而不是C#中的'。'),使用'::'命名空间等。

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.

托管C是为了简化从经典C ++到.NET Framework的过渡。它不是用于启动新项目(C#是首选)。

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).

这篇关于托管c ++和c ++之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆