Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Learn C++ by Example: Covers versions 11 to 23
Learn C++ by Example: Covers versions 11 to 23
Learn C++ by Example: Covers versions 11 to 23
Ebook624 pages4 hours

Learn C++ by Example: Covers versions 11 to 23

Rating: 0 out of 5 stars

()

Read preview

About this ebook

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.

Foreword by Matt Godbolt.

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.

Table of Contents

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
6 Smart pointers and polymorphism
7 Associative containers and files
8 Unordered maps and coroutines
9 Parameter packs and std::visit
LanguageEnglish
PublisherManning
Release dateApr 2, 2024
ISBN9781638354710
Learn C++ by Example: Covers versions 11 to 23
Author

Frances Buontempo

Frances Buontempo has many years of C++ experience. She has given talks on C++ and is an editor of ACCU’s Overload magazine.

Related to Learn C++ by Example

Related ebooks

Programming For You

View More

Related articles

Reviews for Learn C++ by Example

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Learn C++ by Example - Frances Buontempo

    P fbook_preview_excerpt.html}ےǑ寤FfR! #Qh23YTfTU2yBQ&}ߘїpwtiteEFxqg/_еۗ/k4]ᶮnWGxD>x$<_ɾvWEs䇢0'O/1X!^?mlfn'n*\Wmw(~ ^qUn _w}Ln4Ʉ\jn7ɗ7d][tMU]4noWmvp|:J,BPfߍsWȗ][|7TOoMuǙѢo\G`ʉ$3Nݰ*>AdfYܯʏP=-(B=l׈HN)v7(oq}/u W4zpw Q"!CUQduYNݴe~9g/{ fcܻY~/˪d8N~/3!ɾ;dv]u{ z|5Q>ǰٺWA#6ǓekQ/n䆭{_֛,Pɗ,B,ƹaG\n%[\QuX}sCup(oDA{ѓM!.dĚ Eld=ӱLs-M{[w2ok-VyN@mVb<,u ؔ*D#ǨCWN@t;C ̓LP6ۣˤq.p[%|⚱W䛮c^LK zטAT۫kܣPw уî|z_7nH)/d@o8w=دm[ =|9xΪsKm?[ 4hE3Ec2 ىڦ!*,98dw*4({#UknD6(Ñ[WiG[)0N 4KgZqs7bFyP 6:ʧʹ歾 2j#a[ON Q8t0錱_"xuխ?ȨǑ*GbWx3=OѡC?E,N`h#HBUYb7ۈ+NX7L"C&?=Ⓒ^ vy/wmtB͌,d;  El?+G$ `M2Q+E2Ug\ⷩ޻n,SϕUE+N0횲?jLGXch5ô v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