C++ Brain Teasers: Exercise Your Mind 🔍
Anders Schau Knatten
The Pragmatic Bookshelf, LLC, 1, 2024
英语 [en] · EPUB · 2.4MB · 2024 · 📘 非小说类图书 · 🚀/lgli/lgrs/zlib · Save
描述
C++ is famous for getting all the default behaviors wrong and for sometimes making demons fly out of your nose. Through 25 puzzles, from the useful to the outright weird, we explore some of C++'s most interesting quirks. How does initialization actually work? Do temporaries even exist? Why is `+!!"" ` a valid expression in C++? As you work through each puzzle, you will peel off some of the layers of complexity of C++, getting a fundamental understanding of how the language works. This will help you write better code and recognize issues more easily while debugging. Each puzzle in the book is a complete, seemingly simple C++ program, but can you figure out the output for each, or will the answers stump you? Most of the programs compile and have deterministic, though sometimes surprising, output. Some might, however, have undefined behavior, where anything can happen, including making demons fly out of your nose! Yet others might have unspecified behavior with output that is not completely deterministic; we just know nothing as bad as nasal demons will happen. All puzzles are accompanied by detailed discussions, taking a look under the hood at what exactly is going on to help you understand more about C++'s unexpected behaviors, as well as fundamental concepts like initialization, overload resolution, and implicit conversions. For the non-deterministic cases, we'll explore some typical behaviors one can expect to see in practice, what causes them, and why they shouldn't be relied on. After working through the book, you'll have tools and techniques to help you write better and safer code, and a better understanding of the fundamentals of the language, the background for some of C++'s apparent weirdness, and a better feel for identifying bugs and unsafe code in your own programs. What You Need: The book assumes basic knowledge of C++. If you want to run the programs yourself, you can use either a local C++ compiler or the online compilers at https: //godbolt.org.
备用文件名
lgrsnf/sanet.st_C++ Brain Teasers-9798888650981.epub
备用文件名
zlib/no-category/Anders Schau Knatten/C++ Brain Teasers_30067570.epub
备用出版商
Pragmatic Programmers, LLC, The
备用出版商
GLOBAL ENTERTAINMENT SRL
备用版本
United States, United States of America
备用版本
Italy, Italy
元数据中的注释
Published: July 9, 2024 | Version: P1.0 (June 2024)
备用描述
Foreword by Olve Maudal
Acknowledgments
Preface
How to Use This Book
Undefined Behavior
Unspecified and Implementation-Defined Behavior
Playing Around with the Code
Part I. C++ Brain Teasers
Puzzle 1. How Many Degrees?
Puzzle 2. String Theory
Puzzle 3. Hack the Planet!
Puzzle 4. Going Global
Puzzle 5. A Destructive Relationship
Puzzle 6. Who’s Up First?
Puzzle 7. All Good Things Must Come to an End
Puzzle 8. Will It Move?
Puzzle 9. Counting Copies
Puzzle 10. A Strange Assignment
Puzzle 11. What’s the Time of Death?
Puzzle 12. A False Start
Puzzle 13. A Constant Struggle
Puzzle 14. Aristotle’s Sum of Parts
Puzzle 15. Back from the Future
Puzzle 16. An Overloaded Container
Puzzle 17. A Strong Point
Puzzle 18. Moving Out
Puzzle 19. A Little Sum Thing
Puzzle 20. Monsters on the Move
Puzzle 21. Sizing Up Some Characters
Puzzle 22. The Phantom Spaceship
Puzzle 23. Off to a Good Start
Puzzle 24. A Specialized String Theory
Puzzle 25. Weakly Typed, Strongly Puzzling
Acknowledgments
Preface
How to Use This Book
Undefined Behavior
Unspecified and Implementation-Defined Behavior
Playing Around with the Code
Part I. C++ Brain Teasers
Puzzle 1. How Many Degrees?
Puzzle 2. String Theory
Puzzle 3. Hack the Planet!
Puzzle 4. Going Global
Puzzle 5. A Destructive Relationship
Puzzle 6. Who’s Up First?
Puzzle 7. All Good Things Must Come to an End
Puzzle 8. Will It Move?
Puzzle 9. Counting Copies
Puzzle 10. A Strange Assignment
Puzzle 11. What’s the Time of Death?
Puzzle 12. A False Start
Puzzle 13. A Constant Struggle
Puzzle 14. Aristotle’s Sum of Parts
Puzzle 15. Back from the Future
Puzzle 16. An Overloaded Container
Puzzle 17. A Strong Point
Puzzle 18. Moving Out
Puzzle 19. A Little Sum Thing
Puzzle 20. Monsters on the Move
Puzzle 21. Sizing Up Some Characters
Puzzle 22. The Phantom Spaceship
Puzzle 23. Off to a Good Start
Puzzle 24. A Specialized String Theory
Puzzle 25. Weakly Typed, Strongly Puzzling
开源日期
2024-09-11
We strongly recommend that you support the author by buying or donating on their personal website, or borrowing in your local library.
🚀 快速下载
成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️
- 高速服务器(合作方提供) #1 (推荐)
- 高速服务器(合作方提供) #2 (推荐)
- 高速服务器(合作方提供) #3 (推荐)
- 高速服务器(合作方提供) #4 (推荐)
- 高速服务器(合作方提供) #5 (推荐)
- 高速服务器(合作方提供) #6 (推荐)
- 高速服务器(合作方提供) #7
- 高速服务器(合作方提供) #8
- 高速服务器(合作方提供) #9
- 高速服务器(合作方提供) #10
- 高速服务器(合作方提供) #11
- 高速服务器(合作方提供) #12
- 高速服务器(合作方提供) #13
- 高速服务器(合作方提供) #14
- 高速服务器(合作方提供) #15
- 高速服务器(合作方提供) #16
- 高速服务器(合作方提供) #17
- 高速服务器(合作方提供) #18
- 高速服务器(合作方提供) #19
- 高速服务器(合作方提供) #20
- 高速服务器(合作方提供) #21
- 高速服务器(合作方提供) #22
🐢 低速下载
由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)
- 低速服务器(合作方提供) #1 (稍快但需要排队)
- 低速服务器(合作方提供) #2 (稍快但需要排队)
- 低速服务器(合作方提供) #3 (稍快但需要排队)
- 低速服务器(合作方提供) #4 (稍快但需要排队)
- 低速服务器(合作方提供) #5 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #6 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #7 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #8 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #9 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #10 (稍快但需要排队)
- 低速服务器(合作方提供) #11 (稍快但需要排队)
- 低速服务器(合作方提供) #12 (稍快但需要排队)
- 低速服务器(合作方提供) #13 (稍快但需要排队)
- 低速服务器(合作方提供) #14 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #15 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #16 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #17 (无需排队,但可能非常慢)
- 低速服务器(合作方提供) #18 (无需排队,但可能非常慢)
- 下载后: 在我们的查看器中打开
所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
外部下载
-
对于大文件,我们建议使用下载管理器以防止中断。
推荐的下载管理器:JDownloader -
您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
推荐的电子书阅读器:Anna的档案在线查看器、ReadEra和Calibre -
使用在线工具进行格式转换。
推荐的转换工具:CloudConvert和PrintFriendly -
您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
推荐的工具:亚马逊的“发送到 Kindle”和djazz 的“发送到 Kobo/Kindle” -
支持作者和图书馆
✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。
下面的文字仅以英文继续。
总下载量:
“文件的MD5”是根据文件内容计算出的哈希值,并且基于该内容具有相当的唯一性。我们这里索引的所有影子图书馆都主要使用MD5来标识文件。
一个文件可能会出现在多个影子图书馆中。有关我们编译的各种数据集的信息,请参见数据集页面。
有关此文件的详细信息,请查看其JSON 文件。 Live/debug JSON version. Live/debug page.