Book Image

The Modern C++ Challenge

Book Image

The Modern C++ Challenge

Overview of this book

C++ is one of the most widely-used programming languages and has applications in a variety of fields, such as gaming, GUI programming, and operating systems, to name a few. Through the years, C++ has evolved into (and remains) one of the top choices for software developers worldwide. This book will show you some notable C++ features and how to implement them to meet your application needs. Each problem is unique and doesn't just test your knowledge of the language; it tests your ability to think out of the box and come up with the best solutions. With varying levels of difficulty, you'll be faced with a wide variety of challenges. And in case you're stumped, you don't have to worry: we've got the best solutions to the problems in the book. So are you up for the challenge?
Table of Contents (15 chapters)

What this book covers

Chapter 1, Math Problems, contains a series of math exercises to warm you up for the more challenging problems in the next chapters.

Chapter 2, Language Features, proposes problems for you to practice operator overloading, move semantics, user-defined literals, and template metaprogramming aspects such as variadic functions, fold expressions, and type traits.

Chapter 3, Strings and Regular Expressions, has several problems for string manipulation, such as converting between strings and other data types, splitting and joining strings, and also for working with regular expressions.

Chapter 4, Streams and Filesystems, covers output stream manipulation and working with files and directories using the C++17 filesystem library.

Chapter 5, Date and Time, prepares you for the upcoming C++20 extensions to the chrono library, with several calendar and time zone problems that you can solve with the date library, on which the new standard additions are based.

Chapter 6, Algorithms and Data Structures, is one of the largest chapters and contains a variety of problems where you need to utilize the existing standard algorithms; others are where you need to implement your own general-purpose algorithms or data structures, such as circular buffer and priority queue. The chapter ends with two rather fun problems, Dawkins' Weasel program and Conway's Game of Life program, where you can learn about evolutionary algorithms and cellular automata.

Chapter 7, Concurrency, is where we use threads and asynchronous functions to implement general-purpose parallel algorithms, but also solve some real-word problems involving concurrency.

Chapter 8, Design Patterns, proposes a series of problems suited to be solved with design patterns such as decorator, composite, chain of responsibility, template method, and others.

Chapter 9, Data Serialization, covers most common formats of serialized data, JSON, and XML, with several problems; but it also challenges you to create PDF files, all with the use of third-party, open-source, and cross-platform libraries.

Chapter 10, Archives, Images, and Databases, teaches you to solve problems for working with zip archives, creating PNG files for real-world problems, such as Captcha-like systems and barcodes, and embedding and utilizing SQLite databases in your applications.

Chapter 11, Cryptography, mostly covers the user of the Crypto++ library for data encryption and signing. It also challenges you to implement your own Base64 encoding and decoding utilities.

Chapter 12, Networking and Services, is where you have to implement your own client-server application communicating on TCP/IP, and also consume various REST services such as bitcoin exchange rates or text translation APIs.