• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 06, 2022 |9.1K Views
C++ Program to Get and Display IP Address
  Share  2 Likes
Description
Discussion

In this video, we will write a C++ program to get and display the IP addresses.

So the IP address represents an Internet Protocol address of a local system. It's a unique address that identifies the system/device over the network. It serves as a specific machine identifier in a specific network and helps to enhance visual communication between source and destination. There are numerous ways to find an IP address of a local machine. 

IP addresses are 32- bit long and consist of four regions. Each number on the set may range from 0 to 255. Thus, the total IP address range lies from 0.0.0.0 to 255.255.255.255.

Example of IP address: 192.78.34.8

We'll be using the System() and ipconfig commands to get the IP address of our system. 
IPCONFIG stands for Internet Protocol Configuration. It's used to display the IP address, subnet mask, and default gateway for all adapters.

C Program to display hostname and IP address: https://www.geeksforgeeks.org/c-program-display-hostname-ip-address/ 
Amazing stuff with system() in C / C++ https://www.geeksforgeeks.org/amazing-stuff-with-system-in-c-cpp/

Read More