title: Does struct hostent have a field "h_addr"?
body: <p>I encountered the following code snapshot:</p>
  
  <pre><code>struct hostent *hp;
   hp = my_gethostbyname(localhost);
      if (hp == NULL) {
         ls_syslog(LOG_ERR, I18N_FUNC_FAIL, fname, "my_gethostbyname()");
         return -1;
      }
      strcpy(localhost, hp-&gt;h_name);
  
      memcpy(&amp;addr, hp-&gt;h_addr, hp-&gt;h_length);
  </code></pre>
  
  <p>I am rather confused by the last statement, the declaration of struct hostent is like this:</p>
  
  <pre><code>struct hostent {
     char *h_name;       /* official name of host */
     char **h_aliases;   /* alias list */
     int h_addrtype;     /* host address type */
     int h_length;       /* length of address */
     char **h_addr_list; /* list of addresses */
  };
  </code></pre>
  
  <p>It doesn't have a field named "h_addr", but the code did can compile, can anyone tell me why? thanks.</p>