首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

implementation-defined behavior 是什么意思,该怎么解决

2013-10-02 
implementation-defined behavior 是什么意思Similarly,programs usually should avoid implementation-de

implementation-defined behavior 是什么意思
Similarly,programs usually should avoid implementation-defined behavior,such as assuming that the size of an int is a fixed and konwn value.

以上是上下文环境
[解决办法]
就是标准没有做严格规定,允许实现一定自由的语言特征。
比如 int 到底占用几个字节,通常 4 字节;char 到底是 signed 还是 unsigned,一般是 signed。
好的程序不应该依赖于这些假设,否则换个编译环境后,程序行为可能就不正确了。

[解决办法]
相当于machine-dependent,因为所谓的implementation就是在machine上面实现的。

热点排行