<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.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://www.jackxiang.com/post//</link>
<title><![CDATA[C语言如何比较两个【字符】或者【字符串】是否相等？strcmp]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Thu, 12 Mar 2015 08:02:47 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	Q:<br/>C语言如何比较两个【字符】或者【字符串】是否相等？<br/>A:<br/>比较字符可以直接使用==比较操作符，如：<br/>char c1=&#039;a&#039;,c2=&#039;b&#039;;<br/>if(c1==c2) printf(&quot;%c is same as %c.&quot;,c1,c2);<br/>else printf(&quot;%c is different to %c&quot;,c1,c2);<br/><br/>若是字符串，则需要使用字符串函数了，strcmp<br/>char s1[]=&quot;abc&quot;,s2[]=&quot;xyz&quot;;<br/>if(strcmp(s1,s2)==0) printf(&quot;%s is same as %s.&quot;,s1,s2);<br/>也可以忽略大小写来比较，使用函数stricmp 中间的i意思是ignore case sensitive<br/>还可以指定长度比较，strncmp，如：<br/>char s1[]=&quot;abc&quot;,s2[]=&quot;abcdefg&quot;;<br/>if(strncmp(s1,s2,3)==0) printf(&quot;first 3 characters are same&quot;);<br/>若不是从开头位置开始比较，如：<br/>char s1[]=&quot;abc&quot;,s2[]=&quot;xyzabc&quot;<br/>if(strncmp(s1,&amp;s2[3],3)==0) 就是比较s1和s2的第3个字符开始的内容<br/><br/>Egg:<br/>#include &lt;string.h&gt;<br/><br/>char s1[10],s2[10];<br/>...<br/>if(strcmp(s1,s2)==0)<br/> printf(&quot;两字符串相等&#92;n&quot;);<br/><br/><br/>string.h 头文件中就有比较函数,可以用来比较是否相等<br/><br/>来自：http://zhidao.baidu.com/link?url=9gRfWtoqGKzO_Y-aSb5H56QDSkKTblfzFYBoWrggRtxNaXSF3YI1MSo_gnsYvsoVdL_bN4AqEULfDLKMLvZtoq
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] C语言如何比较两个【字符】或者【字符串】是否相等？strcmp]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>