freeprogrammingbooks.com

Think C++

By Allen B. Downey

C++ powers operating systems, game engines, financial trading platforms, embedded devices, and the performance-critical backbone of nearly every major software system. Its combination of low-level control and high-level abstraction makes it the language of choice when speed and efficiency matter most.

Despite being decades old, C++ continues to evolve with each new standard, maintaining its relevance in fields from game development to high-frequency trading.

Learning C++ is a challenge worth taking. It forces you to understand memory management, type systems, and compilation — concepts that higher-level languages hide from you. Mastering C++ gives you a deeper understanding of how computers actually work, and that knowledge transfers to every other language you will ever learn.

About the book

Think C++ by Allen B. Downey is a concise introduction to C++ designed for beginners with no prior programming experience. The same author of the widely praised Think Python and Think Java series brings his proven teaching methodology to C++: start simple, build intuition through clear examples, and introduce complexity only when the reader is ready.

The book covers the essentials of C++ programming, from basic variables and types through object-oriented programming and dynamic data structures. Each concept is illustrated with working code examples, explained step by step, and reinforced with exercises. The complete source code is available on GitHub, and the book itself is licensed under Creative Commons, making it free to download, share, and adapt.

What you will learn

  • Variables, types, expressions, and basic I/O in C++
  • Functions, parameters, return values, and recursion
  • Control flow with conditionals and iteration
  • Strings, vectors, and standard library containers
  • Object-oriented programming with classes and objects
  • Pointers, references, and manual memory management
  • Dynamic data structures: linked lists, stacks, queues, and trees
  • Template programming with generic types
  • File I/O and persistent data storage
  • Debugging techniques and program design strategies

Table of contents

  1. The way of the program
  2. Variables and types
  3. Functions
  4. Conditionals and recursion
  5. Fruitful functions
  6. Iteration
  7. Strings
  8. Vectors
  9. Structures
  10. Vectors of structures
  11. Classes
  12. Vectors of objects
  13. Objects of vectors
  14. Pointers and references
  15. Linked lists
  16. Stacks and queues
  17. Sets and maps
  18. Templates
  19. Memory management
  20. File input/output

More books in: C++, Programming


Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.