title: Connecting to a specific IP address in C?
body: <p>I've done all my testing for my basic chat server and client by using this in the client code:</p>
  
  <pre><code>    struct sockaddr_in server;
    struct hostent * hp;
  
    server.sin_family = PF_INET;
    hp = gethostbyname( "localhost" );
    if ( hp == NULL )
    {
      perror( "Unknown host" );
      return EXIT_FAILURE;
    }
  </code></pre>
  
  <p>The emphasis is on the "localhost." This code has worked fine. Now I'm trying to test it between two computers, and I'm uncertain how to specify the name/address of the server I'd like to connect to. What needs to be changed?</p>