As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center提供指导。




已关闭10年。




最初,我曾经相信,由于C++是C的超集,因此应该没有理由C++比C慢,但是许多使用SO的人并不这么认为https://stackoverflow.com/questions/2245196/c-urban-myths/2245221#2245221

C++比C慢是真的吗?如果没有,为什么仍然要使用C?

最佳答案

C++不是C的超集。

可以用两种语言制作的程序,它们的效率相同或相同。

该论点可能来自任何高级语言,您将拥有更多高级功能,并且很可能会使用它们。如果您以较低级别的语言重新实现这些功能,那么情况可能会更糟。但是,如果不使用较低级的语言,则可能意味着您不太可能使用它们。

可能您用任何一种语言制作的任何程序,都不会引起任何区别。

关于c++ - C真的比C++快吗? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3702776/

10-11 22:44
查看更多