I instantiated a struct using "struct sockaddr_in sockIP4addr;"
I want to assign my IP address to sockIP4addr's sin_addr member which is a struct. What is the correct way to do that?
inet_pton(AF_INET, ipAddr, &sockIP4addr.sin_addr);
inet_pton(AF_INET, ipAddr, &sockIP4addr.sin_addr.s_ad
Because technically the s_addr
field is what holds the IP address.