精通C++17:实战示例解析

5星 · 超过95%的资源 需积分: 11 177 下载量 74 浏览量 更新于2024-07-19 3 收藏 2.45MB PDF 举报
"C++17 By Example - Stefan Björnander" C++17是C++编程语言的一个重要版本,它引入了许多新特性和优化,增强了语言的效率和易用性。这本书“C++17 By Example”由Stefan Björnander撰写,旨在通过实践项目帮助读者深入理解并掌握C++17的关键概念和技术。 作者首先介绍了C++的基础知识,包括语言构造,这些是理解和完成书中的项目所必需的。在项目实践中,读者将学习到如何有效地处理文件,以及如何在软件中使用指针,这些都是系统编程和嵌入式编程的核心元素。文件处理和指针操作是C++的基础,它们允许程序员直接操控内存,实现高效的数据存储和检索。 接下来,书中通过构建图形用户界面(GUI)应用程序,使用Qt 5框架来展示C++在GUI编程中的应用。Qt是一个跨平台的C++库,广泛用于开发桌面和移动应用程序,它的使用能帮助开发者创建具有现代界面的交互式应用。 游戏设计部分则让读者深入了解C++在娱乐软件开发中的运用。通过构建两个有趣的游戏,读者可以学习到游戏逻辑、对象导向编程、事件处理和性能优化等技巧。游戏开发不仅锻炼了编程技能,也体现了C++在实时性和性能上的优势。 最后,书中的一个模块讲解了如何使用C++创建领域特定语言(DSL)。DSL是一种专为特定领域或任务定制的编程语言,这展示了C++的灵活性和可扩展性,使其能够为特定问题提供简洁而强大的解决方案。 读完这本书后,读者不仅能掌握C++17的核心编程概念,还能了解到如何根据实际需求有效地实施这些概念。不论是对于初学者还是有经验的开发者,这本书都提供了丰富的实践经验和深入的理解,有助于提升C++编程能力。
2009-02-12 上传
Every day, more and more people learn and use the C++ programming Language. I have taught C to thousands of students in my life. I see many of those students now moving to C++ in their school work or career. The C++ language is becoming an industry-accepted standard programming language, using the solid foundation of C to gain a foothold. C++ is simply a better C than C. C++ By Example is one of several books in Que抯 new line of By Example series. The philosophy of these books is simple: The best way to teach computer programming concepts is with multiple examples. Command descriptions, format syntax, and language references are not enough to teach a newcomer a programming language. Only by looking at numerous examples and by running sample programs can programming students get more than just a 揻eel?for the language. Table of Contents Overview I Introduction to C++ 1 Welcome to C++ 2 What Is a Program? 3 Your First C++ Program 4 Variables and Literals 5 Character Arrays and Strings 6 Preprocessor Directives 7 Simple Input/Output II Using C++ Operators 8 Using C++ Math Operators and Precedence 9 Relational Operators 10 Logical Operators 11 Additional C++ Operators III C++ Constructs 12 The while Loop 13 The for Loop 14 Other Loop Options 15 The switch and goto Statements 16 Writing C++ Functions IV Variable Scope and Modular Programming 17 Variable Scope 18 Passing Value 19 Function Return Values and Prototyping 20 Default Arguments and Function Overloading V Character Input/Output and String Functions 21 Device and Character Input/Output 22 Character, String, and Numeric Functions Contents x VI Arrays and Pointers 23 Introducing Arrays 24 Array Processing 25 Multidimensional Arrays 26 Pointers 27 Pointers and Arrays VII Structures and File Input/Output 28 Structures 29 Arrays of Structures 30 Sequential Files 31 Random-Access Files 32 Introduction to Object-Oriented Programming VIII References A Memory Addressing, Binary, and Hexadecimal Review B Answers to Review Questions C ASCII Table D C++ Precedence Table E Keyword and Function Reference F The Mailing List Application Glossary Index