From the course: Level Up: C++

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

IP address validation

IP address validation - C++ Tutorial

From the course: Level Up: C++

IP address validation

(bouncy music) - [Instructor] For challenge eight, you'll get to examine the contents of a string and run a few tests to determine whether it's a valid IP address or not. Your task is to write an application that reads a string from the terminal and response with a message indicating whether the string is a valid IP address or not. IP or internet protocol. Addresses are large numbers used on the internet and other computer networks to identify computers. For this challenge, we will use IPv4 addresses which are 32 bits wide. IP addresses are usually expressed in a human readable format, and the most popular is a series of four numbers in decimal separated by dots. So please assume decimal IP addresses, to validate the string. Consider that all numbers must be between zero and 255. So some examples of valid IP addresses would be the strings 158.25.2.33 or 192.168.0.1 Some examples of invalid IP addresses would be the…

Contents