Hi all,
char temp[50];
printf("Current system IP is: %s", inet_ntoa(*((struct in_addr *)temp)));
I have these lines, and it's basically feeding me with crap IP addresses (one is a 252.x.x.x and another 40.x.x.x) which are both wrong as my IPs are 192.168.x.x and 24.x.x.x (it does the 40.x address second time around in the procedure that I'm calling)
I'm wondering whether I need to do a htons() but am new to network programming and C in general, so wondering if there is anyone that could help me,
Thanks