ANSI / ISO C ++和C ++ / CLI有什么区别? [英] What is the difference between ANSI/ISO C++ and C++/CLI?

查看:122
本文介绍了ANSI / ISO C ++和C ++ / CLI有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


由Microsoft创建的.NET技术的基础
,Common
语言基础设施(CLI)是一个
ECMA标准(ECMA-335)它允许
应用程序以
编写各种高级编程
语言并在不同的
系统环境中执行。符合CLI的编程语言具有
访问相同的基类库
并且能够被编译成
相同的中间语言(IL)
和元数据。 IL然后进一步将
编译成特定架构的本地代码特定

Created by Microsoft as the foundation of its .NET technology, the Common Language Infrastructure (CLI) is an ECMA standard (ECMA-335) that allows applications to be written in a variety of high-level programming languages and executed in different system environments. Programming languages that conform to the CLI have access to the same base class library and are capable of being compiled into the same intermediate language (IL) and metadata. IL is then further compiled into native code particular to a specific architecture.

由于这个中间步骤,
应用程序不会必须从头开始重写
。他们的IL只有
需要进一步编译成
系统的本地代码。

Because of this intermediate step, applications do not have to be rewritten from scratch. Their IL only needs to be further compiled into a system's native code.

系统环境

此外,在学习Ivor Horton的开始Visual C ++ 2008 ,我注意到他说,有基本上不同种类的C ++应用程序可以用Visual C ++ 2008开发。这些是:

Additionally, while studying Ivor Horton's Beginning Visual C++ 2008, I noticed that he stated that there are fundamentally different kinds of C++ applications can be developed with Visual C++ 2008. These are:


  1. 在计算机上本机执行的应用程序,他称为本机C ++程序。本机C ++程序是在由ISO / ANSI语言标准定义的C ++版本中编写的。

  1. Applications which execute natively on one's computer, which he referred to as native C++ programs. Native C++ programs are written in the version of C++ that is defined by the ISO/ANSI language standard.

应用程序也可以写入,在C ++的扩展版本中的CLR,称为C ++ / CLI。这些程序称为 CLR程序 C ++ / CLI程序

Application can also be written to run under the control of the CLR in an extended version of C++, called C++/CLI. These programs were referred to as CLR programs, or C++/CLI programs.

那么,本地C ++程序和CLR程序是什么意思呢?它们之间有什么区别?感谢任何专家的帮助。

So what is meant by native C++ programs and CLR programs? What's the difference between them? Thanks for any expert's help.

推荐答案

系统环境是指Linux,Windows x86,Windows x64等。他们在段落末尾可互换使用架构一词。

"System environments" means things like Linux, Windows x86, Windows x64, etc. Notice how they use the term "architecture" interchangeably at the end of the paragraph.

本地C ++程序标准(ANSI / ISO)C ++,并将其编译为.exe。通常你会为特定的环境编译这个,例如。 Windows x86,在这种情况下,它无法在Linux下运行,并在Windows x64上的 WoW64仿真层下运行。值得注意的是,此代码直接在机器上运行。

A native C++ program is one where you take standard (ANSI/ISO) C++ and you compile it into a .exe. Usually you will be compiling this for a specific environment, e.g. Windows x86, in which case it could not run under Linux and would run under the WoW64 emulation layer on Windows x64. Notably, this code runs directly on the machine.

C ++ / CLI是一种与标准C ++不同的编程语言。它,就像C#或VB.NET,运行在微软的 C ommon L anguage I 接口之上。这意味着它可以访问您引用的段落中的所有那些漂亮的东西,如基类库和IL编译,允许它在不同的体系结构上运行。但是,就像C#和VB.NET,它不在本机上运行在机器上。它需要安装.NET Framework; .NET Framework的一部分工作是将C ++ / CLI程序翻译为本地程序,这意味着它们对机器的直接访问少得多。

C++/CLI is a different programming language than standard C++. It, just like C# or VB.NET, runs on top of Microsoft's Common Language Interface. This means it has access to all those nice things in the paragraph you quoted, like the base class library and compilation to IL which allows it to be run on different architectures. But, just like C# and VB.NET, it does not run natively on the machine. It requires the installation of the .NET Framework; part of the .NET Framework's job is translating C++/CLI programs into native programs, which means they have much less direct access to the machine.

这篇关于ANSI / ISO C ++和C ++ / CLI有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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