title: gethostbyname() function returns empty buffer
body: <p>I am new to internet programming, and I am trying to use the <code>gethostbyname()</code> function. When I input a string such as &quot;www.yahoo.com&quot; to gethostbyname function it works fine, but when I input a char array, it will always return an empty buffer.</p>
  <pre><code>  char hostname[100];
    struct hostent* h;
    gethostname(hostname, sizeof hostname );
    printf(&quot;Hostname: %s\n&quot;, hostname);
    h = gethostbyname(hostname);
  </code></pre>
  <p>Any idea how to solve this?</p>