Book description
Learn the latest features of modern C++ by coding eight engaging projects.Don’t let the multitude of C++ updates intimidate you! Learn C++ by Example takes you through the major language changes since C++ 11, with each new feature demonstrated with a fun project or minigame. It’s perfect for beginners who know C++ basics, coders coming back to the language, or current C++ developers missing out on everything the language has to offer.
Inside Learn C++ by Example you’ll find important skills such as:
- Utilizing the new C++ features from C++ 11 to 23
- Effectively testing your C++ code
- What happens “under the hood” of C++ code
- Picking efficient algorithms and data structures
- std::format, STL algorithms, ranges, and coroutines
Learn C++ by Example rapidly gets up to speed with C++’s updates and changes, and ensures you’ll stay ahead as the language continues to change and grow. You’ll learn about vectors and ranges by generating Pascal’s triangle, create a racing game with new special member functions, build a slot machine with parameter packs, and more.
About the Technology
C++ delivers the flexibility and performance you need for everything from low-level systems programming to secure financial applications and AAA game development. First introduced in 1985, the language is still evolving, with exciting changes in every new version. Whether you’re just getting started or you’re a veteran coder adding to your toolbox, the eight hands-on projects in this book will get you up to speed on modern C++ features and practices.
About the Book
Learn C++ by Example is a fun and practical way to start writing modern C++ code. It guides you through entertaining challenges, emphasizing features and techniques made possible by C++ 17, 20, and 23. You’ll learn about objects and arrays by creating a deck of playing cards, master the C++ random library for a number guess game, use the chrono library to create a countdown timer, and much more. Along the way you’ll also pick up valuable tips for testing, project organization, and other productivity skills.
What's Inside
- New C++ features from C++ 11 to 23
- Effectively test your C++ code
- What happens “under the hood”
- Efficient algorithms and data structures
About the Reader
Requires beginner to intermediate C++ skills.
About the Author
Frances Buontempo is an experienced C++ developer and the editor of ACCU’s Overload magazine.
The technical editor on this book was Timothy Jaap van Deurzen.
Quotes
Familiarity, and then mastery, sneak up on you as you work your way through. Suddenly you find yourself to be proficient!
- Guy Davidson, BSI Chair of Programming Languages
Breaks down new C++ features in a friendly and approachable way—something even experienced C++ developers can benefit from! Very enjoyable.
- Nina Dinka Ranns, C++ committee secretary
The hands-on approach and mini-projects will bring you both joy and insight.
- Sy Brand, Microsoft
A tour de force of modern C++!
- Silas S Brown, Oracle
A great book! The examples show you the most modern code possible.
- Andreas Fertig Unique Code GmbH
Table of contents
- inside front cover
- Learn C++ by Example
- Copyright
- dedication
- contents
- Front matter
- 1 Hello again, C++!
- 2 Containers, iterators, and ranges
- 3 Input of strings and numbers
- 4 Time points, duration, and literals
-
5 Creating and using objects and arrays
-
5.1 Creating a deck of playing cards
- 5.1.1 Defining a card type using a scoped enum for the suit
- 5.1.2 Defining a card type using a strong type for the face value
- 5.1.3 Constructors and default values
- 5.1.4 Displaying playing cards
- 5.1.5 Using an array to make a deck of cards
- 5.1.6 Using generate to fill the array
- 5.1.7 Comparison operators and defaults
- 5.2 Higher-or-lower card game
- Summary
-
5.1 Creating a deck of playing cards
- 6 Smart pointers and polymorphism
- 7 Associative containers and files
- 8 Unordered maps and coroutines
- 9 Parameter packs and std::visit
- appendix. Further resources
- index
Product information
- Title: Learn C++ by Example
- Author(s):
- Release date: March 2024
- Publisher(s): Manning Publications
- ISBN: 9781633438330
You might also like
book
Effective Modern C++
Coming to grips with C++11 and C++14 is more than a matter of familiarizing yourself with …
book
The C++ Programming Language, 4th Edition
The new C++11 standard allows programmers to express ideas more clearly, simply, and directly, and to …
book
C++ Crash Course
Upgrade your Code with C++ C++ is one of the most widely used languages for real-world …
book
Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards
Learn the C++ programming language in a structured, straightforward, and friendly manner. This book teaches the …