为什么C ++使用指针?

编程入门 行业动态 更新时间:2024-10-24 06:29:03
本文介绍了为什么C ++使用指针?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为什么C ++需要和使用指针?我知道他们增加了语言的力量,但他们让初学者很难理解。

Why does C++ need and use pointers? I know they add power to the language but they make it a lot harder to understand for beginners. Languages like F#, Java, Ruby, Python, Lua, etc. get by just fine without them, and they're quite powerful.

推荐答案

如果没有F#,Java,Ruby,Python,Lua等语言,

您提到的所有其他语言(和你忘了,至少,Java !!!),虽然每个非常有用和可用,不要让你在任何地方接近机器C ++(和C)允许:只是所有这些语言都会强加给你一个更高层次的抽象......这些都可能很好但会偶尔会妨碍你。

All other languages you mention (and you forgot, at least, Java!!!), while each very useful and usable, don't let you get anywhere as close to the machine as C++ (and C) allow: simply put, all of those languages impose on you a higher level of abstraction... which may mostly be fine but will occasionally get in your way.

C ++是一个更大和更复杂的语言,因为它允许在真正低层次的抽象(非常接近机器)和在相当高的水平(接近您提到的许多语言)

C++ is a bigger and more complicated language because it allows programming at really low levels of abstraction (very close to the machine) AND at pretty high levels (close to many of the languages you mention) within the same language, indeed within the same source files.

初学者建议远离这个数量的权力和(不可避免的)并发症 - 而不是 >每个程序员是一个初学者,并不是每个位的代码需要(或者实际上,可以在所有 !)在一个环境中,让我们保护穷人shmucks自己作为主要设计目标!)

Beginners are well advised to stay FAR away from this amount of power and (inevitably) complication -- but not every programmer is a beginner, and not every bit of code needs (or, actually, can at all stand!-) being within an environment that has "let's protect the poor shmucks from themselves" as a major design goal!-)

更多推荐

为什么C ++使用指针?

本文发布于:2023-06-01 10:26:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/412953.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:指针

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!