由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C 和 C++ 相比有什么优点?
相关主题
class D:public B;An interesting C++ compile error
从一个Embedded C++ quiz 调查看印度人的实力谁来解释一下这个是compiler问题吗?
问个弱的问题:能不能开发两种C++的compiler,一种是编译型的,一种是解释型的关于Makefile的一个问题
C array关于C++ STL编译的疑问
A C++ compiler related interview questionquestion for C++ constant
From C++ to Ca question about CAST
大牛给介绍一下Objective C vs C++ 的优劣吧c++标准函数传递一问
A tech question (转载)C++ 的 问题
相关话题的讨论汇总
话题: c++话题: simpler话题: language话题: compiler话题: than
进入Programming版参与讨论
1 (共1页)
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还是有优势吧

相关主题
From C++ to CAn interesting C++ compile error
大牛给介绍一下Objective C vs C++ 的优劣吧谁来解释一下这个是compiler问题吗?
A tech question (转载)关于Makefile的一个问题
进入Programming版参与讨论
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
16
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
gc for C/C++,编译器无关。
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的应
用中是不能允许的。
1 (共1页)
进入Programming版参与讨论
相关主题
C++ 的 问题A C++ compiler related interview question
有谁知道怎么把matlab和VC联接着一起用? (转载)From C++ to C
Question about a C++ compilation error on Visual Studio 2005大牛给介绍一下Objective C vs C++ 的优劣吧
弱问mcc和mex的区别A tech question (转载)
class D:public B;An interesting C++ compile error
从一个Embedded C++ quiz 调查看印度人的实力谁来解释一下这个是compiler问题吗?
问个弱的问题:能不能开发两种C++的compiler,一种是编译型的,一种是解释型的关于Makefile的一个问题
C array关于C++ STL编译的疑问
相关话题的讨论汇总
话题: c++话题: simpler话题: language话题: compiler话题: than