title: IP address from host name in windows socket programming
body: <p>I want to convert host name (computer name My Computer ->property -> Advance System Setting ->computer Name) to IP Address.</p>
  
  <p>Is there any way can I convert host name to IP address?
  I have tried following but pHostInfo coming as NULL.
  and hostname is my computer name.</p>
  
  <pre><code>struct hostent* pHostInfo;
  pHostInfo = gethostbyname(hostname);
  </code></pre>
  
  <p>In above code it is coming as NULL. Can you please give me code that convert host name to IP address?</p>