title: Explain parameters of getaddrinfo( )
body: <p>What I don't understand is the <code>**res</code> double pointer, in the man page it states: </p>
  
  <blockquote>
    <p>The hints argument points to an addrinfo structure that specifies
    criteria for selecting the socket address structures returned in the
    list pointed to by res.</p>
  </blockquote>
  
  <p>I see that <code>*hints</code> is a pointer to the <code>addrinfo</code> struct but how is <code>**res</code> returning the socket address structures?</p>
  
  <p><a href="http://linux.die.net/man/3/getaddrinfo" rel="nofollow">Specification</a>:</p>
  
  <pre><code>int getaddrinfo(const char *node, const char *service,
                  const struct addrinfo *hints,
                  struct addrinfo **res);
  
  
  struct addrinfo {
      int              ai_flags;
      int              ai_family;
      int              ai_socktype;
      int              ai_protocol;
      socklen_t        ai_addrlen;
      struct sockaddr *ai_addr;
      char            *ai_canonname;
      struct addrinfo *ai_next;
  };
  </code></pre>