[SDL] convert IPaddress to string

1337p337 1337p337 at gmail.com
Mon Jul 17 12:12:06 PDT 2006


On 17/07/06, Roger D. Vargas <roger at ehtsc.co.cu> wrote:
> What is the best way to convert the host member of IPaddress struct to a
> printable string?

There doesn't seem to be a function for this in SDL_Net (looking
briefly over the docs), but you could probably get away with
sprintf(ip_string, "%s", inet_ntoa((struct in_addr) ip.host);

Make sure to include sys/socket.h, netinet/in.h, and arpa/inet.h.
Hope that helps.




More information about the SDL mailing list