About C++ Crash Course
A fast-paced, thorough introduction to modern C++ written for experienced programmers. After reading C++ Crash Course, you’ll be proficient in the core language concepts, the C++ Standard Library, and the Boost Libraries.
C++ is one of the most widely used languages for real-world software. In the hands of a knowledgeable programmer, C++ can produce small, efficient, and readable code that any programmer would be proud of.
Designed for intermediate to advanced programmers, C++ Crash Course cuts through the weeds to get you straight to the core of C++17, the most modern revision of the ISO standard. Part 1 covers the core of the C++ language, where you’ll learn about everything from types and functions, to the object life cycle and expressions. Part 2 introduces you to the C++ Standard Library and Boost Libraries, where you’ll learn about all of the high-quality, fully-featured facilities available to you. You’ll cover special utility classes, data structures, and algorithms, and learn how to manipulate file systems and build high-performance programs that communicate over networks.
You’ll learn all the major features of modern C++, including:
- Fundamental types, reference types, and user-defined types
- The object lifecycle including storage duration, memory management, exceptions, call stacks, and the RAII paradigm
- Compile-time polymorphism with templates and run-time polymorphism with virtual classes
- Advanced expressions, statements, and functions
- Smart pointers, data structures, dates and times, numerics, and probability/statistics facilities
- Containers, iterators, strings, and algorithms
- Streams and files, concurrency, networking, and application development
Downloading the Code
C++ Crash Course contains well over 500 code samples & nearly 100 exercises.
You can download all of them from Github.
You can clone the repository:
git clone git@github.com:JLospinoso/ccc
Or simply download the files using your browser:
So long as you have CMake, Boost, and git installed, you can then build all the examples with an out-of-source build:
cd ccc
git submodule init
git submodule update
mkdir build
cd build
cmake ..
Errata
To report an erratum, please submit an issue on Github https://github.com/JLospinoso/ccc/issues.
Typos
- p. 62 "Whether array_5 is initialized or not..." Should read "Whether array_4 is initialized or not..."
- p. 78 "Each Element also contains a prefix array (5) and an operating_number pointer (6)." Should read "... and an operating_number short."
- p. 128 The copy constructor in Listing 4-38 should use braced initializers for its member initializer, as in Listing 4-35.
-
p. 130 The Move Assignment checkmark is in the wrong place:
- p. 187 Listing 7-2 should throw a std::overflow_error at (4).
- p. 188 "This argument is used to member initialize the private field value." Should read "This argument is used to member initialize the public field value."
- p. 203 Listing 7-14 Caption, "A refactor of Listing 7-13 using a static_cast..." should read "A refactor of Listing 7-13 using a reinterpret_cast...".
- p. 251 "..., you call va_list with the va_list structure" should read "..., you call va_end with the va_list structure"
- p. 284 Figure 10-1, the direction of the arrows, SpeedUpdate, CarDetected, BrakeCommand, are reversed.
- p. 327 Listing 10-50: "publish(A<BrakeCommand>)" should read "publish(A<BrakeCommand>())"
- p. 328 Table 10-2: "A<type>)()" should read "A<type>()"; "An<type>)()" should read "An<type>()"
- p. 404 At Table 12-16, table header "Distribution" should read "Operation".
- p. 404 The subtitle "A Partial List of Random Number Distributions" should read "A Partial List of Operations Available in <ratio>".
- p. 456 "You can remove subtrees from a ptree using the get_child method, ..." should read "You can get subtrees from a ptree using the get_child method, ..."
Up-to-date Links
Introduction
p. xxxv: Companion Code
Foreword: An Overture to C Programmers
p. xxxix: C Constructs That Don't Work in C++
Chapter 1: Up and Running
p. 6: Wandbox
p. 6: Compiler Explorer
p. 6: Visual Studio 2017 Community Edition Download
p. 10: GCC, the GNU Compiler Collection
p. 10: Clang: a C language family frontend for LLVM
p. 11: GCC mirror sites
p. 11: GnuPG
p. 12: Installing GCC: Configuration
p. 12: Installing GCC: Building
p. 12: Installing GCC: Testing
p. 12: Installing GCC
p. 12: The gcc-help mailing list archives
p. 23: Visual Studio Walkthrough: Debugging a Project (C++)
p. 25: About LLDB and Xcode
p. 25: GDB: The GNU Project Debugger
p. 25: The LLDB Debugger
p. 28: Debugging with GDB
p. 28: Stack Overflow
p. 28: CPP Subreddit
p. 28: CPP Slack
p. 29: CPPCast
p. 29: CPPReference
p. 29: CPlusPlus
p. 29: The "Draft" ISO C++ Standard (2017)
Chapter 2: Types
p. 35: The IEEE Standard for Floating-Point Arithmetic, IEEE 754.
p. 65: C++ Made Easier: Plain Old Data
Chapter 3: Reference Types
p. 86: Microsoft Security Bulletin MS01-033 - Critical (Code Red)
p. 87: C++ Core Guidelines
p. 87: East End Functions
p. 87: References
Chapter 6: Compile-time Polymorphism
p. 171: The Origin Library
Chapter 7: Expressions
p. 189: HeapAlloc
p. 189: malloc
p. 207: HSV Conversion
Chapter 10: Testing
p. 304-5, 309: Catch2
p. 310, 325, 328: Google Test/Google Mocks Documentation
p. 317: Boost Test
p. 333: HippoMocks
p. 337: FakeIt
p. 337: Trompeloeil
p. 339: Editor War
p. 339: Is TDD Dead?
Chapter 11: Smart Pointers
p. 349: Boost Smart Pointer
p. 363: Boost Intrusive
p. 387: Boost DateTime
Chapter 12: Utilities
p. 401-403: Boost Numeric Conversion
Chapter 13: Containers
p. 415: CPPReference
p. 415: CPlusPlus
p. 433: Boost Container
Chapter 15: Strings
p. 500: Boost Lexical Cast
p. 512, 515: Boost String Algorithms
Chapter 17: Filesystems
p. 551: Boost Filesystem
p. 571: The dir Command
p. 571: The ls Command
Chapter 18: Algorithms
p. 637: Boost Algorithm
p. 638: Boost Range
p. 638: Algorithmic Complexity
Chapter 19: Concurrency and Parallelism
p. 643: Integer Factorization
p. 655: Boost Lockfree
p. 662: C++ and The Perils of Double-Checked Locking
p. 662: Effective Concurrency: Know When to Use an Active Object Instead of a Mutex
Chapter 20: Network Programming with Boost Asio
p. 665: Boost Asio
p. 667: IANA Service Name and Transport Protocol Port Number Registry
p. 677: Boost Beast
p. 677: IETF RFCs
p. 677: Boost Beast example projects
p. 684: IANA Service Name and Transport Protocol Port Number Registry
p. 685: netcat
p. 689: nmap
Chapter 21: Applications
p. 704: Boost Program Options
p. 713: Boost Python