title: How to convert uint32_t to struct in_addr?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;sys/socket.h&gt;
  #include &lt;netinet/in.h&gt;
  #include &lt;arpa/inet.h&gt;
  
  int main()
  {
  uint32_t ip = 0;
  printf("%s\n",inet_ntoa(*(struct in_addr *)ip));
  return 0;
  }
  </code></pre>
  
  <p>I don't want to do this by declaring any temporary variable. This program gives segmentation fault.</p>
  
  <pre><code>struct in_addr {
      uint32_t s_addr; 
  };
  </code></pre>