<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[linux c 通过hostname获得ip地址]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Sat, 24 Jun 2017 04:45:32 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<textarea name="code" class="php" rows="15" cols="100">
#include &lt;stdio.h&gt;
#include &lt;netdb.h&gt;
int main()
&#123;
        struct hostent *he;
        char hostname[40]=&#123;0&#125; ;
        char ipaddr[40]=&#123;0&#125;;

        strcpy(hostname,&quot;www.baidu.com&quot;);                                               
        gethostname(hostname,sizeof(hostname));
        he = gethostbyname(hostname);
        printf(&quot;%d-handle-gethostbyname&#92;n&quot;,he);
        printf(&quot;hostname=%s&#92;n&quot;,hostname);
        //printf(&quot;%s&#92;n&quot;,inet_ntoa(*(struct in_addr*)(he-&gt;h_addr)));
    char destIP[128];
    char **phe = NULL;
    for( phe=he-&gt;h_addr_list ; NULL != *phe ; ++phe)
    &#123;   
        inet_ntop(he-&gt;h_addrtype,*phe,destIP,sizeof(destIP));
        printf(&quot;addr:%s&#92;n&quot;,destIP);

    &#125;   
&#125;

</textarea><br/><br/><br/>./gh <br/>529960480-handle-gethostbyname<br/>hostname=justwinit-php-mysql_bj_sjs_10_44_202_177<br/>addr:127.0.0.1<br/><br/>来自：http://blog.csdn.net/zzz_781111/article/details/7372024
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] linux c 通过hostname获得ip地址]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>