C++ Brain Teasers : Exercise Your Mind (Paperback)
暫譯: C++ 腦筋急轉彎:鍛鍊你的思維 (平裝)
Knatten, Anders Schau
- 出版商: Pragmatic Bookshelf
- 出版日期: 2024-07-09
- 售價: $1,540
- 貴賓價: 9.5 折 $1,463
- 語言: 英文
- 頁數: 140
- 裝訂: Quality Paper - also called trade paper
- ISBN: 9798888650516
- ISBN-13: 9798888650516
-
相關分類:
C++ 程式語言
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
Design Patterns: Elements of Reusable Object-Oriented Software (Hardcover)$2,480$2,430 -
人月神話:軟體專案管理之道 (20 週年紀念版)(The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition, 2/e)$480$379 -
Introduction to Fourier Optics, 3/e (Hardcover)$1,490$1,460 -
$650Ivor Horton's Beginning Visual C++ 2010 (Paperback) -
PowerPoint 2010 超 Easy$249$211 -
OpenCL Programming Guide (Paperback)$2,160$2,052 -
Audio Effects: Theory, Implementation and Application (Hardcover)$6,290$5,975 -
$330程序員修煉之道 :從小工到專家 (The Pragmatic Programmer: From Journeyman to Master) -
Effective Modern C++:提昇 C++11 與 C++14 技術的 42個具體作法 (中文版)(Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14)$580$458 -
Python 程式設計實務-從初學到活用 Python 開發技巧的16堂課$560$437 -
$356C++ 多線程編程實戰 -
演算法技術手冊, 2/e (Algorithms in a Nutshell: A Practical Guide, 2/e)$580$458 -
$237Keras 快速上手:基於 Python 的深度學習實戰 -
Machine Learning with Core ML$1,650$1,567 -
鳳凰項目 : 一個 IT 運維的傳奇故事 (修訂版)$414$393 -
$555雲原生模式 -
輕鬆學會 Google TensorFlow 2 人工智慧深度學習實作開發, 3/e$620$483 -
Kent Beck 的測試驅動開發:案例導向的逐步解決之道 (Test-Driven Development: By Example)(TDD)$560$436 -
圖解無母數分析$380$342 -
Understanding Deep Learning (Hardcover)$2,150$2,107 -
$418深入淺出 Docker, 2/e -
Claude Code Vibe Coding 開發手冊$750$592 -
AI Agent 開發全書:原理、框架與企業落地$648$615 -
使用 Spring AI 打造企業 RAG 知識庫$820$647 -
Dify AI 智能體開發實戰$474$450
商品描述
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.
商品描述(中文翻譯)
C++ 以其錯誤的預設行為而聞名,有時甚至會讓惡魔從你的鼻子裡飛出來。透過 25 道謎題,從實用到奇怪,我們探索 C++ 最有趣的特性。初始化實際上是如何運作的?臨時變數真的存在嗎?為什麼 +!!"" 在 C++ 中是一個有效的表達式?當你逐一解決這些謎題時,你將逐步揭開 C++ 的複雜性,對這門語言的運作有基本的理解。這將幫助你寫出更好的程式碼,並在除錯時更容易識別問題。
書中的每道謎題都是一個完整的、看似簡單的 C++ 程式,但你能找出每個程式的輸出嗎?還是會讓你感到困惑?大多數程式可以編譯並且有確定性,雖然有時候會讓人驚訝。然而,有些程式可能會有未定義的行為,任何事情都有可能發生,包括讓惡魔從你的鼻子裡飛出來!而其他程式可能會有未指定的行為,輸出並不完全確定;我們只知道不會發生像鼻子裡飛出惡魔那樣糟糕的事情。
所有謎題都附有詳細的討論,深入探討發生了什麼,以幫助你更了解 C++ 的意外行為,以及初始化、重載解析和隱式轉換等基本概念。對於那些非確定性的情況,我們將探討一些在實踐中可以預期的典型行為,造成這些行為的原因,以及為什麼不應依賴它們。
在完成這本書後,你將擁有幫助你寫出更好、更安全程式碼的工具和技術,對語言的基本概念有更深入的理解,了解 C++ 明顯奇怪之處的背景,並能更好地識別自己程式中的錯誤和不安全的程式碼。
你需要的知識:
本書假設你對 C++ 有基本的了解。如果你想自己運行程式,可以使用本地的 C++ 編譯器或訪問 https://godbolt.org 的線上編譯器。