第二个问题是:我什么时候使用这两个?
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++ 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
读取输入文件,最快的方法?read input files, fastest way possible?(读取输入文件,最快的方法?)
在 C++ 中读取格式化输入的最简单方法?The easiest way to read formatted input in C++?(在 C++ 中读取格式化输入的最简单方法?)
从 .txt 文件读取到 C++ 中的二维数组Reading from .txt file into two dimensional array in c++(从 .txt 文件读取到 C++ 中的二维数组)
如何在 C++ 中模拟按键按下How to simulate a key press in C++(如何在 C++ 中模拟按键按下)
为什么在 cin.ignore() 之后没有 getline(cin, var) 读取Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(为什么在 cin.ignore() 之后没有 getline(cin, var) 读取
scanf 格式输入的 cin 类比是什么?What is the cin analougus of scanf formatted input?(scanf 格式输入的 cin 类比是什么?)