今天C ++的可移植性如何 [英] How portable is C++ today
问题描述
谈到代码可移植性,大多数人会认为C是比C ++更好的选择。这可能是5年或10年前的事,但今天怎么样?b $ b?还有很多平台或设备没有好的C ++编译器吗? C ++提供了比C更多的东西,你会用它来构建一个新的跨平台项目,它将支持各种各样的b / b $ b平台,比如从手持设备到多节点服务器?
-
Metaosp
Hi,
When it comes to code portability, most people would think C is a better
choice then C++. That was probably true 5 or 10 years ago, but how
about today? Are there still many platforms or devices that have no
good C++ compiler? C++ offers a lot more then C, would you use it to
build a new cross-platform project that will support a wide range of
platforms, say from handheld devices to multi-nodes servers?
--
Metaosp
推荐答案
>
标准C ++非常便携。我开发的主要是针对unix(g ++版本> 3.)
就像系统一样,但我在Windows上编译代码(MS-VC ++ 2003和
以后)从来没有问题。但是,一旦你开始使用系统特定的东西
线程/互斥/微定时器或窗口系统,你可能会遇到小的或大的可移植性问题。如果C ++(和C)会为标准库添加多线程和微定时器,那将是很好的,因为我认为很多现代系统需要或者在某些现实系统中使用它们方式。
-
问候,Ron AF Greve
http://moonlit.xs4all.nl
" Metaosp" <我***** @ gmail.com>写在消息
news:1140870891.20935.21.camel@jupiter ...
Hi,
Standard C++ is very portable. I develop mostly for unix (g++ version > 3.)
like systems but I never have a problem compiling the code (MS-VC++ 2003 and
later) on windows. However as soon as you start to use system specific stuff
threading/mutexes/micro timers or windowing systems than you likely do have
a small or large portability problem. It would be great if C++ (and C) would
add multi threading and micro timers to the standard libraries since I think
a lot of modern systems need or use them in some way.
--
Regards, Ron AF Greve
http://moonlit.xs4all.nl
"Metaosp" <me*****@gmail.com> wrote in message
news:1140870891.20935.21.camel@jupiter...
谈到代码可移植性,大多数人会认为C是比C ++更好的选择。这可能是5年或10年前的事,但今天怎么样?是否仍有许多平台或设备没有良好的C ++编译器? C ++提供了比C更多的东西,你会用它来构建一个新的跨平台项目,支持各种各样的平台,比如从手持设备到多节点服务器吗? >
-
Metaosp
Hi,
When it comes to code portability, most people would think C is a better
choice then C++. That was probably true 5 or 10 years ago, but how
about today? Are there still many platforms or devices that have no
good C++ compiler? C++ offers a lot more then C, would you use it to
build a new cross-platform project that will support a wide range of
platforms, say from handheld devices to multi-nodes servers?
--
Metaosp
Metaospaécrit:
Metaosp a écrit :
在代码可移植性方面,大多数人认为C是比C ++更好的选择。
When it comes to code portability, most people would think C is a better
choice then C++.
将C ++代码转换为C的工具。 br />
Tools exist to convert C++ code to C.
loufoque写道:
loufoque wrote:
Metaospaécrit:
Metaosp a écrit :
说到代码可移植性,大多数人会认为C是比C ++更好的选择。
When it comes to code portability, most people would think C is a
better choice then C++.
将C ++代码转换为C的工具。
Tools exist to convert C++ code to C.
>
转换?并不是的。有些编译器会编译为C.
那些通常不会产生任何类型的C代码,可以成功地用于人类。
Brian
Convert? Not really. There are some compilers that will compile to C.
Those don''t usually produce any kind of C code that can be used by
humans successfully.
Brian
这篇关于今天C ++的可移植性如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!