title: C - Get a string of an IP address using sin_addr
body: <p>I'm trying get an IP address from <code>struct in_addr</code> and put it in a <code>char</code> array. I've tried the following code but I got the segmentation fault error.</p>
  
  <pre><code>char ip[30];
  strcpy(ip, (char*)inet_ntoa((struct in_addr)clt.sin_addr));
  </code></pre>
  
  <p>Can anyone tell me how to fix this?</p>