C和C的关系++ [英] Relationship between C and C++

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

问题描述

在Stroustroup正在设计C ++,他的目标之一是,C ++是一样多的C的超集越好。我明白,这是不是100%的情况下,但多数有良好的C code也C ++ code。

When Stroustroup was designing C++, one of his goals was that C++ were as much a superset of C as possible. I understand that this is not 100% the case, but most of good code in C is also C++ code.

但我听到C99支持很多事情,C ++不(像VLA),并有甚至将是C1X或C0X不管它被称为。因此,C ++是一个超集仅 C89,从那时起C和C ++是很多独立开发pretty?

But I am hearing that C99 supports many things that C++ doesn't (like VLA) and that there is even going to be C1x or C0x whatever it's called. So, C++ is a superset of only old C89 and from then on C and C++ are developing pretty much independently?

推荐答案

C ++是C89 / C90的近超集。 (我不建议写code具有能够编译为C或C ++的目的,虽然。)此后,C99分歧。新的C ++标准(通常称为的C ++ 0x)将有一些尝试更加兼容,但不会有这样的事情作为C99变长数组。斯特劳斯已经EX pressed失望与一些Ç委员会的行动,显然是有期望他们尽量保持接近C ++的兼容性。

C++ is a near superset of C89/C90. (I don't recommend writing the code with the purpose of being able to compile it as either C or C++, though.) Since then, C99 diverged. The new C++ standard (often called C++0x) will have some attempt to be more compatible, but isn't going to have such things as the C99 variable-length arrays. Stroustrup has expressed disappointment with some of the C committee's actions, apparently having expected them to try to keep closer to C++ compatibility.

所以,是的,语言是发散。

So, yes, the languages are diverging.

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

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