Get computer IPv4

I would like to get the computers IPv4 as I am doing socket testing

All I want to do it:

std::string ipv4 = GetIpv4();
Then
addr.sin_addr.s_addr = inet_addr(ipv4.c_str());
Do you mean on the Internet or on the local network?
For that computer, all it does is basically host it on that computer whenever I use the IPv4 because I want other computers on that network to access and send data, etc
Topic archived. No new replies allowed.