经验丰富的 C 程序员的 C++ 教程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1421668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C++ tutorial for experienced C programmer
提问by Mick
I have been programming exclusively in C for 25 years but have never used C++. I now need to learn the basics of C++ programming. Can anyone recommend an online tutorial (or failing that a book) that would be most suitable for me. Thanks.
我已经专门用 C 编程 25 年了,但从未使用过 C++。我现在需要学习 C++ 编程的基础知识。任何人都可以推荐最适合我的在线教程(或失败一本书)。谢谢。
Edit:I actually needed the C++ purely for the purposes of adding a couple of dirty hacks to a hugeand old C program. Converting the entire program in to properly written OO code is entirely economically unfeasible. Some people have criticized the suggested solutions based on the fact that they will lead me down the path of becoming a "C programmer who knows some C++ without getting in to the proper spirit of C++" - but actually that fits my requirements perfectly.
编辑:我实际上需要 C++ 纯粹是为了向一个庞大而古老的 C 程序添加一些肮脏的黑客。将整个程序转换为正确编写的 OO 代码在经济上是完全不可行的。有些人批评建议的解决方案,因为它们会引导我走上成为“知道一些 C++ 的 C 程序员而没有深入了解 C++ 的正确精神的 C 程序员”的道路 - 但实际上这完全符合我的要求。
Edit:The link in the top voted answer seems to be broken right now but the file appears to exist in multiple places - e.g. here.
编辑:最高投票答案中的链接现在似乎已损坏,但该文件似乎存在于多个地方 - 例如此处。
采纳答案by Donut
This might be of some use: C++ tutorial for C users.
这可能会有用:C 用户的 C++ 教程。
If you're looking for a book, check out "C++ for C Programmers" by Ira Pohl (Amazon).
如果您正在寻找一本书,请查看 Ira Pohl(亚马逊)的“C++ for C Programmers” 。
回答by Steve Fallows
I found Thinking in C++very good when I was going from C to C++.
当我从 C 转到 C++ 时,我发现用 C++ 思考非常好。
Link broken - can now be found here
链接已损坏 - 现在可以在这里找到
回答by adatapost
I'd like to suggest the New C++ Super-FAQcreated by Bjarne Stroustrup, Herb Sutter, Andrei Alexandrescu, Pearson / Addison-Wesley Publishers and Marshall Cline (http://www.parashift.com/c++-faq/).
我想推荐由 Bjarne Stroustrup、Herb Sutter、Andrei Alexandrescu、Pearson/Addison-Wesley Publishers 和 Marshall Cline 创建的New C++ Super-FAQ( http://www.parashift.com/c++-faq/)。
回答by sbi
If you can get hold of a 2nd edition of Scott Meyer's"Effective C++", that should help, as it was written for former C developers. It lists 50 rules that you should follow which are easily to remember, thoroughly explained, and fun to read. (Scott's goal was to write the "best 2nd C++ book" one should read an I think he succeeded in that.)
如果您可以获得Scott Meyer 的“Effective C++”的第二版,那应该会有所帮助,因为它是为前 C 开发人员编写的。它列出了您应该遵循的 50 条规则,这些规则易于记忆、详细解释并且读起来很有趣。(斯科特的目标是写出“最好的第二本 C++ 书”,我认为他在这方面取得了成功。)
The 3rd edition of the book was completely overhauled and targets developers coming from C#, Java etc. more than earlier editions. It might be good read nevertheless.
本书的第 3 版进行了全面修订,与早期版本相比,更多面向来自 C#、Java 等的开发人员。尽管如此,它可能很好读。
回答by StackedCrooked
Accelerated C++is good too.
加速 C++也不错。
回答by Ash
This very recent SO questionasked by an inexperienced C programmer nevertheless has answers that are also relevant to experienced C programmers.
一个没有经验的 C 程序员提出的这个最近的 SO 问题的答案也与有经验的 C 程序员相关。
回答by me22
If you're already a good C programmer, you can probably jump right into the bible, Stroustrup's The C++ Programming Language.
如果您已经是一名优秀的 C 程序员,那么您可能可以直接进入圣经 Stroustrup 的The C++ Programming Language。