s********1 发帖数: 581 | 1 C 和 C++ 相比有什么优点?
一般认为C++ 是 C 的 superset. C 有的功能 C++ 都有,而 C++ 多了Object-
oriented programming 和很多 library functions. 据说C 和 C++ 的速度也差不多。
那么C 还有什么优势吗? |
p***o 发帖数: 1252 | 2 Why you are care about this?
【在 s********1 的大作中提到】 : C 和 C++ 相比有什么优点? : 一般认为C++ 是 C 的 superset. C 有的功能 C++ 都有,而 C++ 多了Object- : oriented programming 和很多 library functions. 据说C 和 C++ 的速度也差不多。 : 那么C 还有什么优势吗?
|
f******y 发帖数: 2971 | 3 C更快,作科学计算很合适。
【在 s********1 的大作中提到】 : C 和 C++ 相比有什么优点? : 一般认为C++ 是 C 的 superset. C 有的功能 C++ 都有,而 C++ 多了Object- : oriented programming 和很多 library functions. 据说C 和 C++ 的速度也差不多。 : 那么C 还有什么优势吗?
|
T*****9 发帖数: 2484 | 4 做科学计算合适和C快不快没有必然联系
【在 f******y 的大作中提到】 : C更快,作科学计算很合适。
|
s********1 发帖数: 581 | 5 如果C 不是更快, 为什么更适于科学计算??]
【在 T*****9 的大作中提到】 : 做科学计算合适和C快不快没有必然联系
|
s********1 发帖数: 581 | 6 既然C++ 包括了 C 的所有功能, 为什么C 会更快呢? 是因为C 的library 更小吗?
【在 f******y 的大作中提到】 : C更快,作科学计算很合适。
|
r*********r 发帖数: 3195 | 7 c++ can be faster than c, if u use templates. |
k**f 发帖数: 372 | 8
Where comes this conclusion?
Generally speaking, Fortran is faster than C or C++ for numerical
calculations. C++ for numerical calculations can be heavily optimized with
expression template, which is not available in C.
The C language is much simpler than C++, so is the C compiler. In some
environments, the simpler one wins.
【在 f******y 的大作中提到】 : C更快,作科学计算很合适。
|
y****e 发帖数: 23939 | 9 expression template 确实能让C++更快,可是不那么容易用
C做embeded还是有优势吧
【在 k**f 的大作中提到】 : : Where comes this conclusion? : Generally speaking, Fortran is faster than C or C++ for numerical : calculations. C++ for numerical calculations can be heavily optimized with : expression template, which is not available in C. : The C language is much simpler than C++, so is the C compiler. In some : environments, the simpler one wins.
|
f*******y 发帖数: 988 | 10 显然C的优势就是不用学C++
【在 y****e 的大作中提到】 : expression template 确实能让C++更快,可是不那么容易用 : C做embeded还是有优势吧
|
|
|
n**d 发帖数: 9764 | 11 "The C language is much simpler than C++, so is the C compiler."
Your word is redundancy. "C lnaguage is simpler" is the same meaning "C
compiler is simpler".
【在 k**f 的大作中提到】 : : Where comes this conclusion? : Generally speaking, Fortran is faster than C or C++ for numerical : calculations. C++ for numerical calculations can be heavily optimized with : expression template, which is not available in C. : The C language is much simpler than C++, so is the C compiler. In some : environments, the simpler one wins.
|
n**d 发帖数: 9764 | 12 It is the performance issue. The overhead in C++ is higher.
General speaking, more instructions are generated by C++ than C for the same
function.
【在 p***o 的大作中提到】 : Why you are care about this?
|
f*******y 发帖数: 988 | 13 当然不是always的
比方说有GC的语言管理内存简单了,compiler不是要更加复杂
【在 n**d 的大作中提到】 : "The C language is much simpler than C++, so is the C compiler." : Your word is redundancy. "C lnaguage is simpler" is the same meaning "C : compiler is simpler".
|
n**d 发帖数: 9764 | 14 Then the argument backs to the definition of "language is simple".
I will say the language is not simple if it has GC management.
【在 f*******y 的大作中提到】 : 当然不是always的 : 比方说有GC的语言管理内存简单了,compiler不是要更加复杂
|
g*****g 发帖数: 34805 | 15 I doubt, it's the VM which does the job.
【在 f*******y 的大作中提到】 : 当然不是always的 : 比方说有GC的语言管理内存简单了,compiler不是要更加复杂
|
f*****Q 发帖数: 1912 | |
O*******d 发帖数: 20343 | 17 在safety critical的环境中,例如飞机发动机控制程序,只用C. 选择C的原因是what
you see is what you get. C的assembly code和source code几乎有对应关系。 而C
++的assembly code被compiler加了大量的额外东西。 这一点在safety critical的应
用中是不能允许的。 |