 <p>You could use something like:</p> <pre><code>#include &lt;stdio.h&gt; static char *ipToStr (unsigned int ip, char *buffer) { sprintf (buffer, "%d.%d.%d.%d", ip &gt;&gt; 24, (ip &gt;&gt; 16) &amp; 0xff, (ip &gt;&gt; 8) &amp; 0xff, ip &amp; 0xff); return buffer; } int main (void) { char buff[16]; printf ("%s\n", ipToStr (0x7d162f7dU, buff)); return 0; } </code></pre> <p>which produces:</p> <pre><code>125.22.47.125 </code></pre>