C ++:它是一种强大的语言吗? [英] C++: Is it a powerful language?
问题描述
为什么C ++是一种强大的语言?它适合工程用途吗?我用b $ b表示,用于进行矩阵操作,数值计算,解决
方程,最后用于文件流。我是否应该直接为C ++迁移
,绕过C?
谢谢,
Why is C++ a powerful language? Does it fit for engineering purpose? I
mean, for doing matrices manipulation, numerical computing, solving
equations, and, eventually, for file streaming. Should I migrate
direct for C++, by-passing the C?
Thanks,
推荐答案
Roberto Dias写道:
Roberto Dias wrote:
为什么C ++是一种强大的语言?
是。
它是否适合工程用途?我的意思是,做矩阵操作,数值计算,求解方程式,
你需要一个好的数学库,C和C的标准库C ++
特别缺乏严格的数值函数(如矩阵,
等......)但是有一些在那里。
最终,文件流。
这种操作应用程序是C和C ++的擅长。
我应该直接迁移到C ++,绕过C吗?
Why is C++ a powerful language?
Yes.
Does it fit for engineering purpose? I
mean, for doing matrices manipulation, numerical computing, solving
equations,
You''ll need a good math library, the standard libraries for C and C++
are notably lacking in rigorous numerical functions (like matrices,
etc..) but there are some out there.
eventually, for file streaming.
This sort of operatal application is what C and C++ excel at.
Should I migrate
direct for C++, by-passing the C?
如果您正在开发具有良好C ++编译器的实现]
existant(以及大多数通用处理程序我会说是的。
C没有真正的优势,并且有很多强有力的理由去做C ++。
性能将会是相同,但代码将更容易使用C ++中更容易维护。
C的唯一参数是某些嵌入式实现,其中
只有最小的C实现才是实用的。
If you''re working on an implementation that has a good C++ compiler]
existant (and most "general purpose" processosrs do), I would say yes.
There''s no real advantage of C and a lot of strong reasons to do C++.
The performance is going to be the same, but the code will be easier
and more maintainable in C++.
The only argument for C is for certain embedded implementations where
only a minimal C implentation is practica.
Roberto Dias写道:
Roberto Dias wrote:
为什么C ++是一种强大的语言?
因为它是这样设计的。
它是否适合工程用途?
确实如此。或者,相反,它是。无论如何。
我的意思是,用于进行矩阵操作,数值计算,求解方程,最后用于文件流。我应该直接迁移到C ++,绕过C吗?
Why is C++ a powerful language?
Because it was designed as such.
Does it fit for engineering purpose?
It does. Or, rather, it is. Whatever.
I
mean, for doing matrices manipulation, numerical computing, solving
equations, and, eventually, for file streaming. Should I migrate
direct for C++, by-passing the C?
我不知道你是不是应该_migrate_(从哪里来?),但是如果你确实迁移了,那么你不需要学习C作为先决条件。知道它们之间的差异
有帮助,并且有时候将C语言作为一种语言可能很有用,
但你绝对可以在迁移路径中选择这一点。
V
I don''t know if you should _migrate_ (from where?), but if you do migrate,
you do not need to study C as a pre-requisite. Knowing the differences
between them helps, and knowing C as a language can be useful sometimes,
but you can definitely pick that all up along the migration path.
V
>为什么C ++是一种强大的语言?
它被编译为C并没有太多的补充。 (指针
到结构的函数,这是C ++中的类......)
> Why is C++ a powerful language?
It''s getting compiled to "C" and not much is getting added. (Pointers
to functions of structures, which are classes in C++ ...)
它是否适合工程目的?我的意思是,用于进行矩阵操作,数值计算,求解方程,最后用于文件流。我是否应该直接迁移到C ++,绕过C?
Does it fit for engineering purpose? I
mean, for doing matrices manipulation, numerical computing, solving
equations, and, eventually, for file streaming. Should I migrate
direct for C++, by-passing the C?
lol。您可以编写C ++程序,如果速度有问题,您可以在类中使用C函数,例如:
// esternal" C"编译此功能
extern" C"
{
DoExternFastMath()
{}
}
//调用快速函数的C ++类包装器
class A
{
内联DoSomeFastMath()
{
DoExternFastMath();
}
}
您可以编写糟糕的C ++代码,您可以在C,FORTRAN和
ASM中执行此操作。
如果你需要有关缓慢和错误的样品,代码,让我知道。我有
很多'如果它;)
-Gernot
lol. You can write C++ programs, and if speed is a problem, you can
use C functions in your classes like:
// esternal "C" compiling of this function
extern"C"
{
DoExternFastMath()
{}
}
// C++ class wrapper that calls a fast function
class A
{
inline DoSomeFastMath()
{
DoExternFastMath();
}
}
You can write crappy C++ code, you can do this in C, in FORTRAN and in
ASM.
If you need samples about slow and buggy, code, let me know. I''ve got
lot''s if it ;)
-Gernot
这篇关于C ++:它是一种强大的语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!