How would I convert an ip address into bytes in C++? Basically how do I parse the IP address? For example, if I have a string equal to 121.122.123.124. I need
121.122.123.124
Using sscanf() function:
sscanf()
#include char arr[] = "192.168.1.102"; unsigned short a, b, c, d; sscanf(arr, "%hu.%hu.%hu.%hu", &a, &b, &c, &d);