Hello,

I have a hostent h_addr and I want to convert that to a string IP address. How can I do that?

I tried this:

Code:
string ipaddress;
struct hostent *h;
h = gethostbyname(hostname.c_str());
ipaddress=h->h_addr;
but that doesnt work..

Thanks!