[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 3.2.2 SDLNet_ResolveIP

`const char *SDLNet_ResolveIP(IPaddress *address)`

address
  This points to the IPaddress that will be resolved to a host name. The address->port is ignored.

Resolve the IPv4 numeric address in address->host, and return the hostname as a string.

Returns: a valid char pointer (string) on success. the returned hostname will have host and domain, as in "host.domain.ext". NULL is returned on errors, such as when it's not able to resolve the host name. The returned pointer is not to be freed. Each time you call this function the previous pointer's data will change to the new value, so you may have to copy it into a local buffer to keep it around longer.

    // resolve the host name of the address in ipaddress
    //IPaddress ipaddress;
    char *host;
    if(!(host=SDLNet_ResolveIP(&ipaddress))) {
        printf("SDLNet_ResolveIP: %s\n", SDLNet_GetError());
        exit(1);
    }

See Also:
3.2.1 SDLNet_ResolveHost, 4.1 IPaddress

This document was generated on November, 3 2009 using texi2html