Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
The Modern C++ Challenge
The Modern C++ Challenge

The Modern C++ Challenge: Become an expert programmer by solving real-world problems

eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

The Modern C++ Challenge

Language Features

Problems

15. IPv4 data type

Write a class that represents an IPv4 address. Implement the functions required to be able to read and write such addresses from or to the console. The user should be able to input values in dotted form, such as 127.0.0.1 or 168.192.0.100. This is also the form in which IPv4 addresses should be formatted to an output stream.

16. Enumerating IPv4 addresses in a range

Write a program that allows the user to input two IPv4 addresses representing a range and list all the addresses in that range. Extend the structure defined for the previous problem...

Solutions

15. IPv4 data type

The problem requires writing a class to represent an IPv4 address. This is a 32-bit value, usually represented in decimal dotted format, such as 168.192.0.100; each part of it is an 8-bit value, ranging from 0 to 255. For easy representation and handling, we can use four unsigned char to store the address value. Such a value could be constructed either from four unsigned char or from an unsigned long. In order to be able to read a value directly from the console (or any other input stream) and be able to write the value to the console (or any other output stream), we have to overload operator>> and operator<<. The following listing shows a minimal implementation that can meet the requested...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Solve a variety of real-world programming and logic problems by leveraging the power of C++17
  • Test your skills in using language features, algorithms, data structures, design patterns, and more
  • Explore areas such as cryptography, communication, and image handling in C++

Description

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?

Who is this book for?

This book will appeal to C++ developers of all levels. There's a challenge inside for everyone.

What you will learn

  • Serialize and deserialize JSON and XML data
  • Perform encryption and signing to facilitate secure communication between parties
  • Embed and use SQLite databases in your applications
  • Use threads and asynchronous functions to implement generic purpose parallel algorithms
  • Compress and decompress files to/from a ZIP archive
  • Implement data structures such as circular buffer and priority queue
  • Implement general purpose algorithms as well as algorithms that solve specific problems
  • Create client-server applications that communicate over TCP/IP
  • Consume HTTP REST services
  • Use design patterns to solve real-world problems

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 23, 2018
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781788994026
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : May 23, 2018
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781788994026
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 103.97
The Modern C++ Challenge
€29.99
C++ Data Structures and Algorithms
€36.99
C++ High Performance
€36.99
Total 103.97 Stars icon
Banner background image

Table of Contents

14 Chapters
Math Problems Chevron down icon Chevron up icon
Language Features Chevron down icon Chevron up icon
Strings and Regular Expressions Chevron down icon Chevron up icon
Streams and Filesystems Chevron down icon Chevron up icon
Date and Time Chevron down icon Chevron up icon
Algorithms and Data Structures Chevron down icon Chevron up icon
Concurrency Chevron down icon Chevron up icon
Design Patterns Chevron down icon Chevron up icon
Data Serialization Chevron down icon Chevron up icon
Archives, Images, and Databases Chevron down icon Chevron up icon
Cryptography Chevron down icon Chevron up icon
Networking and Services Chevron down icon Chevron up icon
Bibliography Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(7 Ratings)
5 star 57.1%
4 star 14.3%
3 star 14.3%
2 star 0%
1 star 14.3%
Filter icon Filter
Top Reviews

Filter reviews by




Jerome Lanteri Dec 20, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is updated at last C++17 code and is talking about everything you have to know about C++ for nice and efficient code.
Amazon Verified review Amazon
Debasish Aug 14, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good
Amazon Verified review Amazon
Imaculate Feb 28, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very unique and practical approach to diving into C++. Highly recommend!
Amazon Verified review Amazon
Leonardo YongUk Kim Feb 04, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I read the first chapter first, and I looked over several chapters according to interest. The first chapter begins with the task of dealing with Fibonaccis, primes, and permutations. In the middle, there are various tasks such as handling strings. Solving several quizs is certainly not an exciting process, but I felt that these challenge really matters to me. It may not be suitable for people who want to do something in a short time. It seems to be the right book for those who want to improve their problem solving skills over time.
Amazon Verified review Amazon
DG Aug 04, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
So far this book is providing a great platform to get familiar with C++.I would recommend this to anyone that needs to get familiar with the language and already has programming experiance.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.