title: Why does it have to cast to struct in_addr in this code?
body: <pre><code>TCPStream::TCPStream(int sd, struct sockaddr_in* address) : msd(sd) 
  {
      char ip[50];
      inet_ntop(PF_INET, (struct in_addr*)&amp;(address-&gt;sin_addr.s_addr), ip, sizeof(ip)-1);
      m_peerIP = ip;
      m_peerPort = ntohs(address-&gt;sin_port);
  }
  </code></pre>
  
  <p>Why does it have to cast to <code>struct in_addr</code> in this code? </p>
  
  <p>What does '50' mean in this code? </p>