Learn C++ in 21 Days (Fifth Edition) cover

Learn C++ in 21 Days (Fifth Edition)

Rating 2.8
Word count
220K words
Chapters
171
ISBN
9787121336324

Tags

Summary

This book offers beginners a comprehensive introduction to C++, covering the language's fundamentals in a systematic way. It comprises 6 parts and 21 chapters. Part 1, C++ Data Representation, covers C++ basics, variables and data types, operators and expressions, and program control structures. Part 2, Procedural Programming in C++, covers functions, preprocessing directives, arrays, pointers, and constructed data types. Part 3, Object-Oriented Programming in C++, covers classes and objects, inheritance, polymorphism, operator overloading, and input/output streams. Part 4 introduces advanced C++ features, including files, namespaces, references, and memory management. Part 5 focuses on C++ programming practice, analyzing the Standard Template Library (STL), templates and the C++ standard library, and exception handling. The final part uses a student grade management system as a case study to explain how to develop real applications with C++. This book is suitable as an introductory tutorial for C++ beginners with no programming background, as a textbook for university faculty and students and training courses, and as a valuable reference for C++ enthusiasts.

Editor's review

21 Days to Learn C++ (5th Edition) is the latest edition in the classic beginner's programming tutorial series from Publishing House of Electronics Industry, written by Liu Lei. The book continues the series' practical, fast-paced approach, aiming to help readers with little or no prior experience quickly master C++ core syntax and object-oriented programming concepts through a structured 21-day learning plan. Compared with previous editions, the 5th edition has been updated to keep pace with current practice: it covers some C++11/14 features and expands practical topics such as development environments and debugging techniques, making the knowledge framework better aligned with the real needs of modern software development.

From an editorial perspective, the book's greatest value lies in its carefully designed step-by-step learning curve. It breaks the vast C++ knowledge system into digestible daily modules, each chapter providing clear example code and end-of-chapter exercises. This learn-by-doing model effectively reduces beginners' anxiety and promotes immediate consolidation of knowledge. Author Liu Lei is experienced in technical education, and her plain, clear prose is particularly good at explaining complex concepts through analogy (for example, comparing classes and objects to blueprints and houses), helping readers build intuitive understanding.

It should be noted, however, that the "21 days" in the title is more of an idealized learning path than a guarantee. C++ is known for its depth and complexity, and true proficiency requires sustained practice and project work well beyond 21 days. The book is therefore best used as a guide from beginner to capable practitioner, helping readers build a solid knowledge skeleton and laying the groundwork for further exploration of advanced topics such as the standard library and template metaprogramming. For readers who want a systematic introduction to C++ and prefer a structured learning pace, this is a reliable and practical choice.

Who it's for

A good fit for

  • Complete beginners who want to learn C++ programming systematically
  • Programmers with experience in other languages (such as C or Java) who want to move quickly into C++ development
  • Self-learners who need a clearly structured tutorial with daily tasks to stay motivated
  • University students in computer-related majors, as a course companion or preview material

Not a good fit for

  • Experienced developers seeking in-depth analysis of advanced C++ features (such as template metaprogramming and the concurrency memory model)
  • Extreme hands-on learners who prefer project-driven learning and dislike step-by-step approaches

Reading tips

  1. Follow the daily plan strictly and be sure to run all example code and complete the exercises; programming skills improve only through repeated hands-on practice
  2. Study with a stable IDE (such as Visual Studio or Code::Blocks); read the environment setup sections carefully
  3. When studying the object-oriented chapters, don't try to understand every concept at once; grasp the basics first and deepen your understanding through later exercises

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. 版权信息
  2. 内容简介
  3. 前言
  4. 第1篇 C++数据表达篇
  5. 第1章 C++入门
  6. 1.1 C++概述
  7. 1.2 程序设计方法
  8. 1.3 C++开发环境——Visual C++ 6.0
  9. 1.4 第一个C++程序——Hello World
  10. 1.5 C++源程序组成元素
  11. 1.6 小结
  12. 1.7 习题
  13. 第2章 变量和数据类型
  14. 2.1 常量
  15. 2.2 变量
  16. 2.3 基本数据类型
  17. 2.4 类型转换
  18. 2.5 小结
  19. 2.6 习题
  20. 第3章 运算符和表达式
  21. 3.1 运算符
  22. 3.2 表达式
  23. 3.3 语句
  24. 3.4 小结
  25. 3.5 习题
  26. 第4章 程序控制结构
  27. 4.1 顺序结构
  28. 4.2 选择结构
  29. 4.3 循环结构
  30. 4.4 转向语句
  31. 4.5 小结
  32. 4.6 习题
  33. 第2篇 C++面向过程设计篇
  34. 第5章 函数
  35. 5.1 函数简介
  36. 5.2 函数参数及原型
  37. 5.3 调用函数
  38. 5.4 变量的作用域
  39. 5.5 函数的作用域
  40. 5.6 函数重载
  41. 5.7 小结
  42. 5.8 习题
  43. 第6章 编译预处理
  44. 6.1 预处理命令
  45. 6.2 宏
  46. 6.3 文件包含
  47. 6.4 条件编译
  48. 6.5 其他命令
  49. 6.6 小结
  50. 6.7 习题
  51. 第7章 数组
  52. 7.1 声明数组
  53. 7.2 引用数组
  54. 7.3 数组的赋值
  55. 7.4 字符串
  56. 7.5 数组与函数
  57. 7.6 数组应用
  58. 7.7 小结
  59. 7.8 习题
  60. 第8章 指针
  61. 8.1 指针概述
  62. 8.2 指针的运算
  63. 8.3 指针与数组
  64. 8.4 指针与函数
  65. 8.5 指针与字符串
  66. 8.6 二级指针
  67. 8.7 小结
  68. 8.8 习题
  69. 第9章 构造数据类型
  70. 9.1 结构体
  71. 9.2 共用体
  72. 9.3 枚举
  73. 9.4 类型重定义typedef
  74. 9.5 位域
  75. 9.6 小结
  76. 9.7 习题
  77. 第3篇 C++面向对象编程篇
  78. 第10章 类和对象
  79. 10.1 类
  80. 10.2 对象
  81. 10.3 构造函数
  82. 10.4 拷贝构造函数
  83. 10.5 析构函数
  84. 10.6 友元
  85. 10.7 小结
  86. 10.8 习题
  87. 第11章 继承
  88. 11.1 继承与派生
  89. 11.2 访问控制
  90. 11.3 派生类的构造函数和析构函数
  91. 11.4 多重继承
  92. 11.5 虚基类
  93. 11.6 小结
  94. 11.7 习题
  95. 第12章 多态
  96. 12.1 多态简介
  97. 12.2 函数重载
  98. 12.3 虚函数
  99. 12.4 抽象类
  100. 12.5 小结
  101. 12.6 习题
  102. 第13章 运算符重载
  103. 13.1 运算符重载简介
  104. 13.2 运算符重载的形式
  105. 13.3 特殊运算符的重载
  106. 13.4 类类型转换
  107. 13.5 小结
  108. 13.6 习题
  109. 第14章 输入/输出流
  110. 14.1 输入/输出流的引入
  111. 14.2 标准输入/输出流
  112. 14.3 输入/输出流成员函数
  113. 14.4 输入/输出的格式控制
  114. 14.5 用户自定义数据类型的输入/输出
  115. 14.6 小结
  116. 14.7 习题
  117. 第4篇 C++高级特性篇
  118. 第15章 文件
  119. 15.1 文件和流
  120. 15.2 文件的打开与关闭
  121. 15.3 文件的顺序读写
  122. 15.4 文件的随机读写
  123. 15.5 小结
  124. 15.6 习题
  125. 第16章 命名空间
  126. 16.1 命名空间简介
  127. 16.2 使用命名空间
  128. 16.3 类的作用域
  129. 16.4 作用域
  130. 16.5 this指针
  131. 16.6 小结
  132. 16.7 习题
  133. 第17章 引用与内存管理
  134. 17.1 引用
  135. 17.2 引用的操作
  136. 17.3 动态内存分配
  137. 17.4 const引用
  138. 17.5 指针与引用的区别
  139. 17.6 小结
  140. 17.7 习题
  141. 第5篇 C++编程实践篇
  142. 第18章 标准模板库STL
  143. 18.1 标准模板库
  144. 18.2 算法
  145. 18.3 容器
  146. 18.4 迭代器
  147. 18.5 小结
  148. 18.6 习题
  149. 第19章 模板与C++标准库
  150. 19.1 模板概述
  151. 19.2 函数模板
  152. 19.3 类模板
  153. 19.4 C++标准库概述
  154. 19.5 字符串库
  155. 19.6 小结
  156. 19.7 习题
  157. 第20章 异常处理
  158. 20.1 错误与异常
  159. 20.2 异常处理的实现
  160. 20.3 类和结构的异常处理
  161. 20.4 异常处理机制
  162. 20.5 小结
  163. 20.6 习题
  164. 第6篇 实例篇
  165. 第21章 简单的学生成绩管理系统开发实例
  166. 21.1 需求分析
  167. 21.2 总体设计
  168. 21.3 功能模块的实现
  169. 21.4 系统集成
  170. 21.5 系统实现
  171. 21.6 小结

FAQ

Can this book really teach someone C++ in 21 days?
"Learn" is relative. The book can help you systematically grasp C++ core syntax, object-oriented programming basics, and essential programming concepts within 21 days, to the point where you can write simple programs and understand common code. But becoming proficient, let alone mastering the language, inevitably requires further project practice and deeper study beyond this foundation.
What are the main updates in the 5th edition compared with older editions?
The main updates in the 5th edition are the introduction of some C++11/14 features (such as auto type deduction and range-based for loops), a more modern introduction to development environments, corrections of some oversights in previous editions, and improvements to some examples and exercises to better match current learning and development habits.
I have absolutely no background and am weak in math and English. Can I understand this book?
The book is written with complete beginners in mind. It requires very little math—mainly basic logic. The English keywords needed for programming are limited and fixed, and the book explains them one by one. As long as you have basic computer skills and a persistent attitude, you can certainly get started with this book.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

刘蕾 Author

Liu Lei is a Chinese book author whose works span two quite different fields: agriculture and forestry, and programming and design. Public information about her is limited, and her nationality, dates of birth and death, and English name have not been clearly recorded. Judging from the three works included in the collection, her writing is clearly practical and introductory in orientation. On the one hand, she contributed to Understanding Chinese Plants: South China Volume, a book intended for plant identification and popular science reading. On the other hand, she is the author of Teach Yourself C in 21 Days (5th Edition) and Teach Yourself C++ in 21 Days (5th Edition), which guide beginners through programming fundamentals in a step-by-step, day-by-day format. Though the two categories are far apart, both stress concrete presentation of knowledge and hands-on usability for readers. Overall, Liu Lei's writing focuses on popularization and instruction, suited to beginners who wish to learn in a structured way, and offers practical reference value to readers in these areas.

More by the same author

Top rated in the same category