Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Paul Deitel, Harvey Deitel

Rating No ratings yet

C++ How to Program: An Objects-Natural Approach is a code-intensive, modular introduction to C++ programming. The Deitel live-code approach presents concepts using full working programs rather than code snippets so that you can immediately start to run programs as you read. Interesting, entertaining and challenging examples, exercises and projects help you see how what you're learning applies to real-world scenarios. The 11th Edition presents new features of C++ 20 and even more hands-on application opportunities. Hundreds of new self-checks let you test your code and understanding of key concepts. New case studies and exercises focus on security, data science, ethics and more.

AI Reading Assistant

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

AI guide
【One-Line Pitch】 A code-intensive, live-code introduction to C++20 that teaches programming through 255 complete, working programs, ideal for beginners and intermediate learners who want to build real-world, high-performance systems. 【Book Arc】 - **Opening (~0%–10%)**: Sets up the book's philosophy—live-code approach with full programs, not snippets—and covers computer fundamentals (bits, fields, records, files, databases) plus how to set up compilers on Windows, macOS, or Linux. This stage solves the "where do I start" problem by grounding you in both hardware concepts and tooling. - **Early (~10%–23%)**: Introduces basic C++ syntax: variables, input/output with `cin`/`cout`, equality and relational operators, and decision-making with `if` statements. Also explains `using` declarations vs. directives, preparing you for namespace management. This stage gets you writing and running simple programs immediately. - **Early (~23%–32%)**: Dives into algorithm development and control statements—`if…else`, blocks, loops (`for`, `while`), and operators like increment/decrement and compound assignment. Includes UML activity diagrams to visualize flow. This stage builds your logic toolkit for structured programming. - **Middle (~32%–48%)**: Covers functions in depth: prototypes, parameter lists, return types, pass-by-value vs. pass-by-reference, and storage classes (local, static local, global). Highlights common pitfalls like assignment-in-condition errors and lvalue/rvalue distinctions. This stage transitions you from scripts to modular, reusable code. - **Middle (~48%–end of sample)**: Continues with advanced function topics—references, function templates, and scope rules—using live-code examples to show how functions interact with caller state. The sample ends here, but the book's arc points toward classes, objects, and C++20 features in later chapters. 【Key Takeaways】 - **Live-code approach accelerates learning** (Opening): 255 complete programs with outputs let you run code as you read, not just study fragments. This bridges theory and practice immediately. - **Computer fundamentals underpin C++** (Opening): Understanding bits, fields, records, files, and relational databases clarifies why C++ structures data the way it does—essential for systems programming. - **Namespace hygiene matters early** (Early): `using namespace std;` simplifies beginner code, but the book returns to `std::` prefixing in Chapter 6 to avoid subtle errors in large systems—a habit worth adopting early. - **Control statements are the backbone of logic** (Early): Blocks, `if…else`, and loops with proper brace usage prevent bugs; the book stresses always using braces even for single statements. - **Operator precedence can make or break code** (Early): Compound assignment (`+=`) and increment (`++`) simplify statements, but pre vs. post forms differ only in larger expressions—knowing this avoids logic errors. - **Functions require rigorous contract checking** (Middle): Prototypes, headers, and calls must agree on return type and parameters; mismatches cause compilation errors, so design function signatures carefully. - **Pass-by-reference vs. value is a performance and safety trade-off** (Middle): Pass-by-value copies data (safe but costly); pass-by-reference avoids copies (efficient but risky). The book shows identical call syntax, so the compiler decides—know your intent. - **Storage classes control variable lifetime** (Middle): Local variables reset each call, static locals retain values, and globals persist—choosing the right scope prevents unintended side effects. 【Reading Tips】 - **Skim the opening chapters (0%–10%)** if you already know computer basics; focus instead on the compiler setup and test-drive sections to get your environment running. - **Deep-read the control statements and functions chapters (23%–48%)**—these are the core of procedural C++. Run every live-code example and modify variables to see behavior change. - **Watch for "Err" markers** in the text; they flag common mistakes (like `if (payCode = 4)` instead of `==`) that are frequent exam and interview traps. - **Use the self-checks** at chapter ends to test understanding; the fill-in and code-correction exercises mirror real debugging scenarios. - **Download the GitHub source code** and compile alongside reading; the book's value is in execution, not passive reading. 【Coverage Limits】 This guide covers the sample excerpts through approximately 48% of the book (functions and references). Later chapters on classes, objects, operator overloading, pointers, and C++20 features are not covered here.
Excerpt 1
mplete, working, real-world C++ programs with live outputs. Read the Before You Begin section that follows this Preface to learn how to set up your Windows,...
View in text
Excerpt 2
Compiling and Running with g++ in the GCC Docker Container You can use the latest GNU C++ compiler on your system, regardless of your operating system. One o...
View in text
Excerpt 3
and the assignment operators =, +=, -=, *=, /= and %= group right-to-left. All other operators in this table group left-to-right. 150 Chapter 4 Control State...
View in text
Excerpt 4
ents the accidental side effects that so greatly hinder the development of correct and reliable software systems. So far, each argument in this book has been...
View in text
Excerpt 5
ues. Usually, a variable directly contains a specific value. A pointer contains the memory address of a variable that, in turn, contains a specific value. In...
View in text
Excerpt 6
he user enters the end-of-file key combination) or an input operation fails, the operator bool returns false, and the while statement terminates. Line 21 wri...
View in text
Excerpt 7
ects and const Member Functions 473 reclaimed by the system. So, declaring a constructor or destructor const is a compilation error. The “constness” of a con...
View in text
Excerpt 8
w can access class Record’s private data members. The func- tion displayRecords should use each Record’s get functions to access the data to display. The mai...
View in text
Tags
AI categories
Programming LanguageC++Education
c/c++
ISBN: B0CF4TX8XG
Publisher: Pearson
Publish Year: 2023
Language: English
Pages: 1240
File Format: PDF
File Size: 9.6 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…