Share E-Book

Mastering C++ Programming (Jeganathan Swaminathan)(Z-Library)

Author Jeganathan Swaminathan

C/C++/C#
Language English

Key Features Get acquainted with the latest features in C++ 17 Take advantage of the myriad of features and possibilities that C++ offers to build real-world applications Write clear and expressive code in C++, and get insights into how to keep your code error-free Book Description C++ has come a long way and has now been adopted in several contexts. Its key strengths are its software infrastructure and resource-constrained applications. The C++ 17 release will change the way developers write code, and this book will help you master your developing skills with C++. With real-world, practical examples explaining each concept, the book will begin by introducing you to the latest features in C++ 17. It encourages clean code practices in C++ in general, and demonstrates the GUI app-development options in C++. You'll get tips on avoiding memory leaks using smart-pointers. Next, you'll see how multi-threaded programming can help you achieve concurrency in your applications. Moving on, you'll get an in-depth understanding of the C++ Standard Template Library. We show you the concepts of implementing TDD and BDD in your C++ programs, and explore template-based generic programming, giving you the expertise to build powerful applications. Finally, we'll round up with debugging techniques and best practices.By the end of the book, you'll have an in-depth understanding of the language and its various facets. What you will learn Write modular C++ applications in terms of the existing and newly introduced features Identify code-smells, clean up, and refactor legacy C++ applications Leverage the possibilities provided by Cucumber and Google Test/Mock to automate test cases Test frameworks with C++ Get acquainted with the new C++17 features Develop GUI applications in C++ Build portable cross-platform applications using standard C++ features About the Author Jeganathan Swaminathan, Jegan for short, is a freelance software consultant and founder of TekTutor, with over 17 years of I

Format EPUB
Size 5.7 MB
187
Views
0
Downloads
0.00
Total Donations

AI Guide

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Full assistant
AI guide
# Mastering C++ Programming — Reading Guide ## 【One-Line Pitch】 A practical, project-oriented tour through modern C++17 that covers language features, the Standard Template Library, generic programming, and professional practices like testing and memory safety — ideal for intermediate developers who want to write cleaner, more maintainable C++ for real-world applications. ## 【Book Arc】 - **Opening (~0%–9%)**: Sets the stage with the book's philosophy — C++ remains irreplaceable for infrastructure and resource-constrained software — and introduces the C++17 feature set, plus the conventions and toolchain (g++ with `-std=c++17`) used throughout. - **Early (~9%–27%)**: Dives into modern language features (e.g., `std::invoke`, inline variables) and then systematically explores STL sequence containers (vector, deque, list, forward_list) and associative containers (set, multiset, unordered variants), including their APIs, performance trade-offs, and common pitfalls. - **Early-to-Middle (~27%–39%)**: Continues with container adaptors (stack, priority queue) and introduces template-based generic programming — function templates that work across built-in and user-defined types, with type-checking at compile time. - **Middle (~39%–48%)**: Advances into class templates, template overloading, and partial template specialization, showing how to combine templates with inheritance for flexible, reusable code — a form of compile-time polymorphism. - **Middle (~48%–52%)**: Shifts to memory management, starting with the dangers of raw pointers — allocation/deallocation scattered across code, double-deletes, and crash risks — setting up the case for smart pointers covered later. - **Late (~52%–100%)**: The excerpts thin out here, but the book's stated trajectory covers smart pointers, multithreading/concurrency, GUI development, TDD/BDD with Google Test and Cucumber, and debugging best practices. ## 【Key Takeaways】 - **C++17 is a practical upgrade, not a revolution** (Early): Features like `std::invoke` for callable objects and inline variables for static member initialization simplify everyday code — worth adopting incrementally in existing projects. - **STL containers each have a personality** (Early): Vectors grow/shrink at runtime but use a plain array underneath; deques offer fast indexed access with bounds-checked `at()` versus faster unchecked `operator[]`; sets enforce uniqueness while multisets allow duplicates — choose based on your access patterns and performance needs. - **Performance has a price in ordering** (Early): Multisets use red-black trees (O(log N) operations, sorted iteration) while unordered multisets use hash tables (O(1) average operations, unsorted) — pick based on whether you need sorted traversal or raw speed. - **Priority queues reorder your data automatically** (Early): A `priority_queue` pops the highest value first regardless of insertion order — useful for scheduling and task-processing scenarios where ordering by priority matters. - **Templates are compile-time polymorphism** (Middle): One function template can sort integers, doubles, or custom objects with a single implementation, and the compiler type-checks at instantiation — inspect assembly with `g++ -S` to see what's generated. - **Partial template specialization is a scalpel, not a sledgehammer** (Middle): You can specialize only some template parameters while inheriting the rest from the primary template — a powerful pattern for reusing generic logic while customizing specific types. - **Raw pointers are a liability in complex systems** (Middle): When allocation and deallocation happen in different places, memory leaks and double-deletes become likely — the book sets up smart pointers as the disciplined alternative. ## 【Reading Tips】 - **Skim the early C++17 feature chapters** (~9%–15%) if you're already familiar with modern C++; focus instead on the STL container sections where the practical API tables and trade-off discussions are dense with usable knowledge. - **Deep-read the template chapters** (~33%–48%): Function templates, class templates, and partial specialization build on each other — work through the code examples line by line, and try compiling them yourself with `g++ -std=c++17`. - **Pay attention to the "pitfalls" callouts** (e.g., vector pitfalls around ~18%): These highlight real-world mistakes that aren't obvious from API documentation alone. - **The memory management section** (~48%–52%) is the bridge to the book's later topics — understand the raw pointer problems thoroughly before moving to smart pointers, or the motivation for the solutions won't land. - **The excerpts don't cover the GUI, TDD/BDD, multithreading, or debugging chapters in detail** — if those are your primary interest, you may need to supplement with other resources or read those chapters directly in the book. ## 【Coverage Limits】 This guide is based on excerpts covering roughly the first half of the book (through ~52%). The later chapters on smart pointers, concurrency, GUI development, test frameworks (Google Test/Mock, Cucumber), and debugging are not covered in the source material. ##

Passage locations

Excerpt 1
m applications using standard C++ features About the Author Jeganathan Swaminathan, Jegan for short, is a freelance software consultant and founder of TekTut...
View in text
Excerpt 2
pes in a linear fashion, which can be accessed sequentially. The STL supports the following sequence containers: Arrays Vectors Lists forward_list  deque As...
View in text
Excerpt 3
fashion is a requirement, then multiset is a good choice. Commonly used APIs in a stack Commonly used APIs in a stack The following table shows commonly used...
View in text
Excerpt 4
cout << "\nPrimary Template Class - Function F1 invoked ..." << endl; cout << "Value of t1 is " << t1 << endl; cout << "Value of t2 is " << t2 << endl; cout...
View in text

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List