Okay, I get the string version of an IP address ("." delimitted) using this:
Code:
in_addr iaIP;
iaIP.S_un.S_un_b.s_b1 = (u_char)FIRST_IPADDRESS(dwIPVal);
iaIP.S_un.S_un_b.s_b2 = (u_char)SECOND_IPADDRESS(dwIPVal);
iaIP.S_un.S_un_b.s_b3 = (u_char)THIRD_IPADDRESS(dwIPVal);
iaIP.S_un.S_un_b.s_b4 = (u_char)FOURTH_IPADDRESS(dwIPVal);
char *ip = inet_ntoa(iaIP);
With dwIPVal correctly filled in. I successfully get the ip in "ip" but I have a simple question: Do I have to free() it? Its a pointer to a char array and I dont see how itd get freed otherwise...
EDIT: Actually... I don't even need the ip variable. But that's okay, I'd like to know if I have to free it anway