Introducing C++ (Fourth Early Release) (Frances Buontempo)(Z-Library)
C++
This book cuts through the noise, focusing on the essential elements of C++ with hands-on projects that quickly build your skills and confidence. Author and C++ expert Frances Buontempo gets you up to speed quickly with the latest features and best practices of the language, preparing you for more advanced exploration.
315
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
AI guide
# Introducing C++ (Fourth Early Release) — Reading Guide
## 【One-Line Pitch】
A hands-on, beginner-friendly introduction to modern C++ that gets you compiling and running real programs from the very first chapter, ideal for programmers new to C++ or those wanting to understand what happens under the hood of higher-level languages.
## 【Book Arc】
- **Opening (~0%–6%)**: Sets expectations for the book and explains the fundamental difference between compiled and interpreted languages, positioning C++ as a low-level, high-control language that compiles directly to machine code.
- **Early (~6%–16%)**: Walks through toolchain setup across Linux, Mac, and Windows, covering clang, GCC, and Visual Studio options, plus essential compiler flags like `-Wall` and `-std:c++latest`.
- **Early (~16%–28%)**: Introduces the `main` function, function structure (head, body, return types), and the concept of types—starting with `int`—while building the first compilable program.
- **Middle (~28%–38%)**: Covers output to the screen using both the modern `println` (C++23) and the traditional `std::cout` with stream insertion operator, including troubleshooting tips for unsupported features.
- **Middle (~38%–47%)**: Deepens understanding of streams, references (`&`), chaining operations, escape sequences, buffering behavior, and the difference between `\n` and `std::endl`, concluding with a summary of key syntax concepts.
## 【Key Takeaways】
- **C++ is a compiled language** (Early): Unlike interpreted languages like Python, C++ source code is transformed directly into machine-specific object files, then linked into an executable—this upfront compilation enables faster runtime performance but requires rebuilding for different target machines.
- **The `main` function is the program entry point** (Early): Every C++ program needs `int main()`, which returns an integer indicating success or failure; by default it returns 0 to signal no errors, and its body is enclosed in curly braces.
- **Functions have a consistent structure** (Early): A function consists of a return type, name, parentheses for parameters, and a body in braces; `void` indicates no return value, and all values in C++ have a type.
- **The standard library extends the core language** (Early): Core types like `int` are built into the language, but features like printing require including headers (e.g., `<print>` or `<iostream>`) from the standard library that ships with your toolchain.
- **Modern C++23 offers `println`, but `cout` remains essential** (Middle): The newer `println` adds a newline automatically, while `std::cout` requires explicit `\n` or `std::endl`; since many codebases still use `cout`, learning both approaches is practical.
- **Streams support chaining and buffering** (Middle): The stream insertion operator `<<` returns the same stream, enabling chained output; output is buffered for efficiency, and `std::endl` flushes the buffer while `\n` does not—important for crash debugging.
- **Whitespace is insignificant in C++** (Early): Unlike Python, C++ uses semicolons to end statements and braces to group code, so indentation is purely conventional for readability rather than syntactically required.
## 【Reading Tips】
- **Set up your toolchain early and test it**: The book walks through compiler installation for all major platforms; actually building the first `empty.cpp` program ensures you understand the compile-link-run cycle before moving on.
- **Run every example and experiment**: The author explicitly encourages playing with code; try modifying the greeting, chaining multiple `<<` operations, and testing both `println` and `cout` to internalize the differences.
- **Pay attention to the troubleshooting section**: If your compiler doesn't support `<print>`, the book explains how to recognize this error and suggests using Compiler Explorer as a fallback—this pattern will recur with newer C++ features.
- **Skim the toolchain-specific instructions**: If you're on one platform, you can skip the detailed setup for others; the command-line patterns are similar across compilers, so focus on understanding the general structure.
- **Don't skip the "under the hood" explanations**: The discussion of references (`&`), namespaces (`std::`), and scope resolution (`::`) in Chapter 1 lays groundwork for everything that follows—these concepts reappear throughout the book.
## 【Coverage Limits】
The excerpts cover only the first two chapters (toolchain setup, basic syntax, and output); later chapters on variables, input, and more advanced topics are not included in this guide.
##
Passage locations
Excerpt 1
d related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the author and do not represent the publisher’s vi...
View in text
Excerpt 2
which always returns an int , indicating success or failure. Create an empty file, call it empty.cpp , and type in this very short program: Example 1-1. Main...
View in text
Excerpt 3
e will crop up in various ways over the course of this book. In simple terms, it groups code together and allows magic to happen at the end of the block. The...
View in text
Excerpt 4
you to use std::endl ; now you know that you have a choice. Conclusion This chapter covered the difference between interpreted and compiled languages. C++ is...
View in text
Recommended for You
{{#thumbnailUrl}}
{{/thumbnailUrl}}
{{^thumbnailUrl}}
{{/thumbnailUrl}}
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