锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久婷婷五月亚洲97号色,伊人久久精品影院,99国内精品久久久久久久http://m.shnenglu.com/liujiajia/category/7032.html瀛︿範銆佸伐浣溿佺敓媧匯傝繖鏄笁涓棶棰樸?/description>zh-cnFri, 30 May 2008 16:01:53 GMTFri, 30 May 2008 16:01:53 GMT60sprint() 鏍煎紡鍖栧啓鍏ュ瓧絎︿覆http://m.shnenglu.com/liujiajia/archive/2008/05/31/51655.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 30 May 2008 16:01:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/31/51655.htmlhttp://m.shnenglu.com/liujiajia/comments/51655.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/31/51655.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/51655.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/51655.html紼嬪簭浠庤鍙栫敤鎴瘋緭鍏ョ殑firstname,lastname鍜宲rize,騫跺皢浠栦滑璇誨彇鐨勫兼寜鐓т竴瀹氭牸寮忓瓨鍌ㄥ埌鍙︿竴涓瓧絎︿覆鏁扮粍鍐呫?/p>
#include<stdio.h>
#define MAX 20
int main(void)
{
    
char first[MAX];
    
char last[MAX];
    
char formal[2*MAX+10];
    
double prize;
    
    puts(
"Enter your first name");
    gets(first);
    puts(
"Enter your last name");
    gets(last);
    puts(
"Enter your prize money");
    scanf(
"%lf",&prize);
    sprintf(formal,
"%s,%-19s:$%6.2f\n",last,first,prize);
    puts(formal);
    
    getchar();
    getchar();
    
return 0;
}


]]>
strcpy() 澶嶅埗瀛楃涓?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/30/51654.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Fri, 30 May 2008 15:57:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/30/51654.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/51654.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/30/51654.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/51654.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/51654.html</trackback:ping><description><![CDATA[涓嬮潰浠g爜婕旂ず浜嗙▼搴忓驚鐜粠鐢ㄦ埛杈撳叆璇誨彇瀛楃涓詫紝騫跺瓨鍏ヤ復鏃剁殑瀛楃涓叉暟緇勶紝鐒跺悗灝嗕復鏃跺瓧絎︿覆澶嶅埗鍒皅words鏁扮粍閲岄潰銆?br><br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> SIZE 40</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> LIM 5</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> qwords[LIM][SIZE];<br>    </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> temp[SIZE];<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    <br>    </span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">LIM </span><span style="COLOR: #000000">&&</span><span style="COLOR: #000000"> gets(temp))<br>    {<br>        <strong>strcpy</strong>(qwords[i],temp);<br>        i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br>    }<br>    puts(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">The list</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">LIM;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        puts(qwords[i]);<br>    }<br>    <br>    getchar();<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <img src ="http://m.shnenglu.com/liujiajia/aggbug/51654.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-30 23:57 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/30/51654.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>strcmp() 姣旇緝瀛楃涓茬殑鍐呭http://m.shnenglu.com/liujiajia/archive/2008/05/30/51653.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 30 May 2008 15:48:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/30/51653.htmlhttp://m.shnenglu.com/liujiajia/comments/51653.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/30/51653.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/51653.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/51653.html
    char try[10];
    
    puts(
"Who is 1+1?");
    gets(
try);
    
while(strcmp(try,"2")!=0)
    {
        puts(
"No,it's wrong.Try again.");
        gets(
try);
    }
    puts(
"OK,That's right");


涓嬮潰紼嬪簭璇存槑鍚勭鎯呭喌涓嬶紝strcmp()鐨勮繑鍥炲鹼細

printf("strcmp(\"a\",\"a\")=%d\n",strcmp("a","a"));
    printf(
"strcmp(\"a\",\"b\")=%d\n",strcmp("a","b"));
    printf(
"strcmp(\"b\",\"a\")=%d\n",strcmp("b","a"));
    printf(
"strcmp(\"a\",\"c\")=%d\n",strcmp("a","c"));
    printf(
"strcmp(\"c\",\"a\")=%d\n",strcmp("c","a"));
    printf(
"strcmp(\"abc\",\"abd\")=%d\n",strcmp("abc","abd"));
    printf(
"strcmp(\"abc\",\"abcd\")=%d\n",strcmp("abc","abcd"));
    printf(
"strcmp(\"abc\",\"abbd\")=%d\n",strcmp("abc","abbd"));



]]>
strcat()鍑芥暟http://m.shnenglu.com/liujiajia/archive/2008/05/27/51323.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Tue, 27 May 2008 12:12:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/27/51323.htmlhttp://m.shnenglu.com/liujiajia/comments/51323.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/27/51323.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/51323.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/51323.html
#include<stdio.h>
#include
<string.h>
int main(void)
{
    
char string1[20];
    
char string2[]="goodbye";
    
    gets(string1);
    strcat(string1,string2);
    puts(string2);
    puts(string1);
    
    getchar();
    
return 0;
}
浠ヤ笂紼嬪簭灝唖tring2瀛楃涓茬殑鎷瘋礉鏀懼埌浜唖tring1鐨勭粨灝俱?br>
鍊煎緱娉ㄦ剰鐨勬槸錛宻tring1鍦ㄨ浣跨敤strcat()鍑芥暟涔嬪墠錛屽簲璇ユ槸宸茬粡鍒濆鍖栨垨鑰呭凡緇忓瓨鍌ㄤ簡涓涓瓧絎︿覆銆傚洜涓哄鏋滃瓧絎︿覆娌℃湁琚垵濮嬪寲錛宻tring1[]閲岄潰鍏冪礌鐨勫瓨鍌ㄦ槸涓涓查殢鏈哄箋俿trcat()闇瑕佹壘鍒皊tring1鐨勭粨灝撅紙絎竴涓嚭鐜扮殑'\0'錛?鐒跺悗鍘繪帀榪欎釜'0',鏈鍚庢妸string2[]鐨勬嫹璐濇斁鍒皊tring1[]鏈鍚庝竴涓肩殑鍚庨潰銆?

]]>
浣跨敤strlen()鑾峰緱瀛楃涓查暱搴?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/27/51321.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Tue, 27 May 2008 11:32:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/27/51321.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/51321.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/27/51321.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/51321.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/51321.html</trackback:ping><description><![CDATA[鍑芥暟鍘熷瀷錛歴ize_t strlen(const char*)<br>浣滅敤錛氳繑鍥炲弬鏁頒腑瀛楃涓茬殑闀垮害銆?br><br>浠ヤ笅浠g爜鏄竴涓埅鍙栧瓧絎︿覆鐨勪緥瀛愶細<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> fit(</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">);<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> msg[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Hello moto</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>    <br>    puts(msg);<br>    fit(msg,</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);<br>    puts(msg);<br>    puts(msg</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">);<br>    getchar();<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}<br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> fit(</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> size)<br>{<br>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(strlen(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">size)<br>    {<br>        </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">size)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">\0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;<br>    }<br>}<br></span></div> 鎴彇鍓嶏細<br> <table style="WIDTH: 320px; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=3 border=1> <tbody> <tr> <td>H</td> <td>e</td> <td>l</td> <td>l</td> <td>o</td> <td>space</td> <td>m</td> <td>o</td> <td>t</td> <td>o</td> <td>\0</td> </tr> </tbody> </table> 鎴彇鍚?br> <table style="WIDTH: 320px; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=3 border=1> <tbody> <tr> <td>H</td> <td>e</td> <td>l</td> <td>l</td> <td>o</td> <td>\0       </td> <td>m</td> <td>o</td> <td>t</td> <td>o</td> <td>\0</td> </tr> </tbody> </table> <br>fit()鏄埅鍙栧瓧絎︿覆鐨勬柟娉曘傚鏋滃瓧絎︿覆鐨勯暱搴﹀ぇ浜庤鎴彇鐨勯暱搴︼紝閭d箞灝嗘寚鍚戣瀛楃涓茬殑鎸囬拡鍚戝悗縐誨姩size浣嶅悗錛屽皢鎸囬拡鎸囧悜鐨勫唴瀹圭疆涓?\0'錛屽嵆瀛楃涓茬粨鏉熴備絾string+size+1澶勪粛鐒跺瓨鍦ㄤ竴涓瓧絎︿覆銆? <img src ="http://m.shnenglu.com/liujiajia/aggbug/51321.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-27 19:32 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/27/51321.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍒濇璁よ瘑鏁扮粍銆佹寚閽堝拰瀛楃涓插叧緋?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/24/50913.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Fri, 23 May 2008 16:27:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/24/50913.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/50913.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/24/50913.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/50913.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/50913.html</trackback:ping><description><![CDATA[<p><strong><span style="FONT-SIZE: 18pt">瀛楃涓叉暟緇勫垵濮嬪寲錛?/span><br>(1)char arr[10]="HI";</strong><br>鍒濆鍖栧瓧絎︿覆鏁扮粍鏃訛紝緙栬瘧鍣ㄨ嚜鍔ㄥ皢瀛楃涓叉渶鍚庝竴涓瓧絎﹀悗闈㈠姞涓?\0',浠ヨ〃紺哄瓧絎︿覆鐨勭粨鏉熴?br>濡傛灉鏁扮粍鐨勫ぇ灝忓ぇ浜庡瓧絎︿覆鐨勯暱搴?1錛岄偅涔堟妸瀛楃涓茬粨鏉熷悗闈㈢殑鍏冪礌涔熼兘鍒濆鍖栦負'\0'; <br>鐪嬭繖孌電▼搴忥細<br>瀹氫箟涓涓ぇ灝忎負12鐨勫瓧絎︿覆鏁扮粍<br>char str1[12]="jiajia";        <br>璁╀竴涓猚har鍨嬬殑鎸囬拡鎸囧悜榪欎釜鏁扮粍<br>    char *p1=str1;<br>杈撳嚭榪欎釜瀛楃涓?br>    printf("%s\n\n",str1);<br>鍒╃敤鎸囬拡杈撳嚭榪欎釜瀛楃涓叉暟緇勪腑姣忎釜鍏冪礌鐨勫瓧絎︺佸瓧絎scii鍊箋佸瓧絎﹀瓨鍌ㄥ湴鍧<br>    for(int i=0;i<12;i++)<br>    {<br>        printf("%c:%d:%p\n",*p1,*p1,p1);<br>        p1++;<br>    }<br>鍙互鐪嬪嚭錛屾暟緇勫厓绱犵殑鍚庡嚑浣嶉兘琚垵濮嬪寲鎴愪簡'\0';浣跨敤printf鎵撳嵃瀛楃涓叉暟緇勬椂錛岀▼搴忛亣鍒扮涓涓?\0'灝辯粨鏉熷瀛楃涓茬殑璇誨彇銆?br><br>濡傛灉鏁扮粍鐨勫ぇ灝忓皬浜庡瓧絎︿覆鐨勯暱搴?1錛岀▼搴忓湪榪愯鏃跺彲鑳借鍑虹幇闂錛屾墍浠ュ簲褰撶‘淇濇暟緇勭殑澶у皬瑕佸ぇ浜庡瓧絎︿覆闀垮害鐨勫ぇ灝?1錛?br><br>榪欐紼嬪簭鐨勫瓧絎︿覆闀垮害+1灝忎簬鏁扮粍鐨勫ぇ灝忥細<br>char str2[12]="hello jiajia";<br>    char *p2=str2;</p> <p>    printf("\n\n\n%s\n\n",str2);<br>    <br>    for(int i=0;i<28;i++)<br>    {<br>        printf("%c:%d:%p\n",*p2,*p2,p2);<br>        p2++;<br>    }<br><br>浣跨敤printf鎵撳嵃瀛楃涓詫紝紼嬪簭闇瑕佹壘鍒?\0'鎵嶈兘緇撴潫璇誨彇錛岀粨鏋滄壘閬嶆暣涓暟緇勬病鏈夋壘鍒幫紝鍙湁緇х畫欏虹潃鍦板潃瀵繪壘錛屼竴鐩存壘鍒版煇涓湴鍧涓婄殑assii鏄?鐨勶紝瀛楃涓叉墠璇誨彇瀹屾瘯銆傛墍浠ユ湰孌電▼搴忓湪璇誨彇瀹?hello jiajia"涔嬪悗錛屽悗闈㈠彲鑳借繕浼氭湁鍑犱釜闅忔満鐨勫瓧絎︼紝灝辨槸鍥犱負瀛楃涓茬粓姝簬'\0'銆?br><br><strong>(2)char arr[]="Hello World!";</strong><br>榪欑鍒濆鍖栨柟娉曚笉鐢ㄦ媴蹇冩暟緇勫ぇ灝忚繃灝忕殑鎯呭喌錛屾暟緇勭殑澶у皬鐢辯紪璇戝櫒鍐沖畾銆?br><strong>(3)char arr[]={'H','e','e','l','o',' ','W','o','r','l','d','\0'};</strong><br>鍚岀浜岀鏂規硶緇撴灉鐩稿悓錛屼絾鏄劇劧瑕侀夯鐑﹁澶氥傚彟澶栵紝' '浠h〃絀烘牸錛宎scii鍊兼槸32錛?\0'浠h〃瀛楃涓茬粨鏉燂紝ascii鍊兼槸0錛?br><strong>(4)char *p="Hello World";</strong><br>浣跨敤鏁扮粍鐨勬柟寮忓垵濮嬪寲銆傚悓鏁扮粍涓嶅悓涔嬪鍦ㄤ簬,p鏄竴涓彉閲忥紝鍙互鍋氶掑銆侀掑噺榪愮畻錛岃宎rr鏄暟緇勭殑棣栧湴鍧錛屾槸涓涓湴鍧甯擱噺錛屼笉鑳藉仛閫掑銆侀掑噺榪愮畻銆?br><br>char *name="liujiajia";<br>    name[0]='L';<br>    printf("\n%s\n",name);<br>name[0]='L';榪欏彞浠g爜鍦ㄦ渶鏂扮殑c99鏍囧噯涓細寮曞彂紼嬪簭寮傚父銆傞渶瑕佹敞鎰忋?br><br><br>char *string="c programe";<br>    char *string2;    <br>    string2=string;    //灝嗘寚閽坰tring鐨勫艱祴緇檚tring2<br>    <br>    printf("\nstring=%s,&string=%p,string=%p\n",string,&string,string);<br>    printf("\nstring=%s,&string=%p,string=%p\n",string2,&string2,string2);<br><br>涓婇潰榪欐紼嬪簭鏈鍚庢樉紺猴紝鎸囬拡string鎵鎸囧悜鐨勫湴鍧鍜屾寚閽坰tring2鎵鎸囧悜鐨勫湴鍧鐩稿悓錛岃繖灝辮鏄庡畠浠寚鍚戠殑鏄唴瀛橀噷闈㈠悓涓涓瓧絎︿覆錛屼篃灝辨槸璇村瓧絎︿覆鏈韓騫舵病鏈夊鍒訛紝鑰屾槸浜х敓浜嗕竴涓寚鍚戝悓涓涓瓧絎︿覆鐨勬寚閽堛傝繖鏍風▼搴忕殑鏁堢巼浼氭洿鍔犵殑楂樸傚鏋滈渶瑕佸鍒跺瓧絎︿覆鍙互浣跨敤 strcpy() 鎴?strncpy()銆?br><br></p> <img src ="http://m.shnenglu.com/liujiajia/aggbug/50913.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-24 00:27 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/24/50913.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍑芥暟鍜屼簩緇存暟緇勭殑鏂拌璇?鍙傛暟鎸囧畾鏁扮粍絎簩緇村拰絎竴緇村ぇ灝?http://m.shnenglu.com/liujiajia/archive/2008/05/20/50581.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Tue, 20 May 2008 14:31:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/20/50581.htmlhttp://m.shnenglu.com/liujiajia/comments/50581.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/20/50581.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/50581.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/50581.html
#include<stdio.h>
#define ROWS 3
#define COLS 4
void sum_rows(int arr[][COLS],int rows);
int main(void)
{
    
int junk[ROWS][COLS]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};
    
    sum_rows(junk,ROWS);
//姹傚嚭姣忚鐨勬暟鍊兼誨拰銆?nbsp;
    
    getchar();
    
return 0;

void sum_rows(int arr[][COLS],int rows)
{
    
int r,c,tot;
    
for(r=0;r<rows;r++)
    {
        tot
=0;
        
for(c=0;c<COLS;c++)
        {
            tot
+=arr[r][c];
        }
        printf(
"row%d,sum=%d\n",r,tot);
    }
}

鎴戜滑閮界煡閬撲笂闈㈢殑浠g爜鍙互欏哄埄鎵ц錛?sum_rows()鐨勫艦鍙傛槸 int arr[][COLS],娌℃湁鎸囧畾鏁扮粍鐨勭涓緇村ぇ灝忋備絾鏄鎯充竴涓嬶紝濡傛灉涓嶆寚瀹氱浜岀淮鐨勫ぇ灝忥紝緇撴灉浼氭庢牱鍛紵
鎴戝啓浜嗕互涓嬩緥瀛愶細
#include <stdio.h> 
int sum2d(int arr[][],int row,int col); 
int main(void

    
int arr[3][4]={{1,2,3,5},{3,4,4,5},{2,3,4,5}}; 
    sum2d(arr,3
,4); 
     
    getchar(); 
    
return 0;  

int sum2d(int arr[][],int row,int col) 

    
for(int i=0;i <row;i++
    { 
        
for(int j=0;j <col;j++
        { 
            printf(
"%d",arr[i][j]);  invalid use of array with unspecified bounds         
        } 
    } 
    
return 0

榪愯鍚庡彂鐜幫紝紼嬪簭鎶ラ敊浜嗭紝榪欐槸涓轟粈涔堝憿錛熺櫨鎬濅笉寰楀叾瑙o紝鍚庢潵璇鋒暀浜咰SDN涓婅佸ぇ浠傜粓浜庣◢寰紕鏄庣櫧浜嗙偣鍎褲傛垜鎯沖叿浣撳簲璇ヤ粠涓ゆ柟闈㈣瘉鏄庝負浠涔堜笂闈㈢殑紼嬪簭涓嶅彲琛屻?br>錛?錛変粠浜岀淮鏁扮粍鐨勫瓨鍌ㄦ柟寮忎笂錛氫簩緇存暟緇勫湪鍐呭瓨涓婃槸涓琛屼竴琛岃繛緇殑瀛樺偍鐨勩傚涓嬪浘錛?br>arr[3][4]
arr[0][0] arr[0][1] arr[0][2] arr[0][3] arr[1][0] arr[1][1] arr[1][2] arr[1][3] ...

鍥犱負arr鏄繖涓暟緇勭殑棣栧湴鍧錛屾垜浠彲浠ョ煡閬揳rr[0][0]鐨勫湴鍧銆傚彧瑕佹垜浠煡閬揳rr[][4]涓暟緇勭浜岀淮鐨勫ぇ灝?#8216;4’錛屾垜浠氨鍙互鎵懼埌浠繪剰琛屽拰鍒楃殑鍦板潃銆俛ddress=arr+(rows-1)*4+cols銆備絾鏄鏋滀笉鐭ラ亾絎簩緇寸殑澶у皬錛岄偅涔堟潯浠跺氨涓嶅浜嗐傛墦涓涓瘮鏂癸紝灝嗚嫢騫蹭釜瀛︾敓鍒嗘垚姣忕粍11浜猴紝騫惰浠栦滑绔欐垚涓鎺掞紝榪欐椂鎴戜滑鍙互瀹氫綅鍑虹鍑犵粍鐨勭鍑犱釜瀛︾敓銆備絾濡傛灉涓嶇煡閬撴瘡緇?1涓漢錛岄偅涔堟垜浠樉鐒跺氨鏃犳硶瀹氫綅浜嗐?br>
錛?錛変粠鎸囬拡鐨勮搴︿笂鐪?榪欑鎬濊礬鎴戣繕鏄湁鐐硅糠緋?:澶у鍙互鍙傜湅榪欎釜甯栧瓙錛?a >http://topic.csdn.net/u/20080520/09/2122e210-5cf5-4b75-b31f-c2523b00cf53.html?575319732

鎭╋紝鐜板湪鏄秺瀛﹁秺榪鋒儜浜嗐傚懙鍛點?br>

]]>
鍑芥暟鍜屼簩緇存暟緇?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50446.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Mon, 19 May 2008 15:03:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50446.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/50446.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50446.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/50446.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/50446.html</trackback:ping><description><![CDATA[闃呰涓嬮潰浠g爜錛岀▼搴忓垪涓句簡3縐嶄簩緇存暟緇勪綔涓哄弬鏁頒紶閫掔殑鏂規硶錛?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> ROWS 3</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> COLS 4</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> sum_rows(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[][COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> rows);<br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> sum_cols(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> [][COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">);        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍙互鐪佺暐鍚嶇О</span><span style="COLOR: #008000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sum2d(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">arr)[COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> rows);   </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍙︿竴縐嶈娉曞艦寮?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> junk[ROWS][COLS]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">},{</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">},{</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">11</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">12</span><span style="COLOR: #000000">}};<br>    <br>    sum_rows(junk,ROWS);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">姹傚嚭姣忚鐨勬暟鍊兼誨拰銆?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);       </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">姹傚嚭姣忓垪鐨勬暟鍊兼誨拰銆?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    sum_cols(junk,ROWS);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">姹傚嚭鍏ㄩ儴鏁板肩殑鎬誨拰銆?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    <br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\nthe sum of the junk is %d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,sum2d(junk,ROWS));<br>    <br>    getchar();<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>} <br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> sum_rows(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[][COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> rows)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> r,c,tot;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(r</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;r</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">rows;r</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        tot</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(c</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;c</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">COLS;c</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            tot</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">arr[r][c];<br>        }<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">row%d,sum=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,r,tot);<br>    }<br>}<br></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> sum_cols(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[][COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> rows)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> r,c,tot;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(c</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;c</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">COLS;c</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        tot</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(r</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;r</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">rows;r</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            tot</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">arr[r][c];<br>        }<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">col%d,sum=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,c,tot);<br>    }<br>}<br><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sum2d(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">arr)[COLS],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> rows)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> r,c,tot</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(r</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;r</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">rows;r</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(c</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;c</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">COLS;c</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            tot</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">arr[r][c];<br>        }<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> tot;<br>}<br></span></div> <img src ="http://m.shnenglu.com/liujiajia/aggbug/50446.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-19 23:03 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/19/50446.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎸囬拡鍜屽緇存暟緇?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50440.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Mon, 19 May 2008 14:28:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50440.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/50440.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/50440.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/50440.html</trackback:ping><description><![CDATA[<strong>涓銆佸緇存暟緇勫湴鍧鍜屾寚閽堢殑鍏崇郴</strong><br>int arr2[4][2]={{1,2},{3,4},{5,6},{7,8}};<br>printf("arr2=%p,&arr2[0]=%p,arr2[0]=%p,&ar2r[0][0]=%p\n",arr2,&arr2[0],arr2[0],&arr2[0][0]);<br><br> <table style="WIDTH: 364px; BORDER-COLLAPSE: collapse; HEIGHT: 91px" cellSpacing=0 cellPadding=3 border=1> <tbody> <tr> <td style="BACKGROUND-COLOR: #ccffcc">arr[0][0] (1)</td> <td>arr[1][0] (3)</td> <td>arr[2][0] (5)</td> <td>arr[3][0] (7)</td> </tr> <tr> <td style="BACKGROUND-COLOR: #ccffcc">arr[0][1] (2)</td> <td>arr[1][1] (4)</td> <td>arr[2][1] (6)</td> <td>arr[3][1] (8)</td> </tr> </tbody> </table> <br><br>涓婇潰鐨勭▼搴忕殑緇撴灉杈撳嚭绔熺劧閮戒竴鏍楓備負浠涔堝憿錛?br>棣栧厛 arr2 浠h〃鐨勬槸arr2鏁扮粍鐨勯鍦板潃錛屾墍浠?arr2鐨勫煎拰 arr2絎竴涓瓙鍏冪礌arr2[0]鐨勫湴鍧鐩稿悓錛屽嵆 &arr2[0]錛?br>arr2[0]鏄惈鏈変袱涓暣褰㈠厓绱犱竴緇存暟緇勭殑棣栧湴鍧錛屽嵆&arr2[0][0]鐨勫箋?br>綆鍗曠殑璇達細arr[0]鏄竴涓暣鏁板ぇ灝忓璞$殑鍦板潃錛宎rr2鏄袱涓暣鏁板ぇ灝忓璞$殑鍦板潃銆傚洜涓烘暣鏁板拰涓や釜鏁存暟緇勬垚鐨勬暟緇勫紑濮嬩簬鍚屼竴涓湴鍧錛屾墍浠?arr2 鍜?arr2[0] 鍏鋒湁鐩稿悓鐨勬暟鍊箋?br><br><strong>浜屻佹寚閽堬紙鍦板潃錛夎繍綆楀拰澶氱淮鏁扮粍鐨勫叧緋?/strong><br>printf("arr2+1=%p,arr2[0]+1=%p\n",arr2+1,arr2[0]+1);<br>鐜板湪鎴戜滑鐭ラ亾錛宎rr2 鍜?arr2[0]鍏鋒湁鐩稿悓鐨勬暟鍊鹼紝浣嗘槸arr2+1鍜宎rr2[0]+1涓轟粈涔堟暟鍊間笉涓鏍峰憿錛熻繖鏄洜涓猴紝arr2鎸囧悜鐨勫璞″ぇ灝忔槸涓や釜int錛屽効arr2[0]鎵鎸囧悜鐨勫ぇ灝忔槸涓涓猧nt銆傛墍浠rr2+1鐨勫艱姣攁rr2[0]+1鐨勫煎涓涓猧nt澶у皬銆?br><br><strong>涓夈佷嬌鐢?瀵瑰緇存暟緇勫彇鍊?/strong><br>鍥犱負 arr2[0] 鏄?arr2[0][0]鐨勯鍦板潃錛屾墍浠?*(arr2[0])浠h〃瀛樺偍鍦╝rr2[0][0]鐨勫箋傚悓鏍鳳紝arr2鏄痑rr2[0]鐨勯鍦板潃錛?arr灝辨槸 arr2[0]鐨勫箋備絾鏄?arr2[0]涔熸槸涓涓湴鍧錛屽嵆&arr2[0][0],鍥犳*arr2鏄?&arr2[0][0]銆傛墍浠?*&arr2[0][0] 絳変環浜?**arr2銆?&arr2[0][0] 鍙互綆鍖栦負 arr2[0][0]銆傛墍浠?arr2[0][0]==**arr2銆?br>綆鑰岃█涔嬶細arr2鏄湴鍧鐨勫湴鍧錛屾墍浠ラ渶瑕佺粡榪囦袱嬈″彇鍊兼墠鑳藉彇鍒板叿浣撶殑鏁板箋?br><br><br>瀛﹀畬榪欎釜鐭ヨ瘑鐐癸紝鎵嶅彂鐜板湪鎸囬拡紜疄寰堥毦鎳傘?br> <img src ="http://m.shnenglu.com/liujiajia/aggbug/50440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-19 22:28 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/19/50440.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎸囬拡鐨勫熀鏈繍綆?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50421.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Mon, 19 May 2008 11:08:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50421.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/50421.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/19/50421.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/50421.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/50421.html</trackback:ping><description><![CDATA[<p>瀵規寚閽堝彲浠ヨ繘琛?strong>璧嬪?/strong>銆?strong>姹傚?/strong>鎴?strong>鍙栧?/strong>銆?strong>鍙栨寚閽堢殑鍦板潃</strong>銆?strong>灝嗕竴涓寚閽堝姞涓婁竴涓暣鏁?/strong>銆?strong>澧炲姞鎸囬拡鐨勫?/strong>銆?strong>姹傚樊鍊?/strong>鐨勬搷浣溿傝鍙傜湅浠ヤ笅浠g爜灞曠ず浜嗗嚑縐嶆儏褰細<br></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> urn[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">100</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">300</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">400</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">500</span><span style="COLOR: #000000">};<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p1,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p2,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p3;<br>    <br>    p1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">urn;         </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎶婁竴涓湴鍧璧嬬粰鎸囬拡 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    p2</span><span style="COLOR: #000000">=&</span><span style="COLOR: #000000">urn[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">];     </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍙栧緱urn[2]鐨勫湴鍧錛屽茍璧嬬粰涓涓寚閽?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    <br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">鏁扮粍鍚勪釜鍏冪礌鐨勫煎拰鍦板潃錛歕n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">); <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">urn[%d]=%d   &urn[%d]=%p;\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,i,urn[i],i,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">urn[i]);<br>    }<br>    <br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n鎸囬拡鎸囧悜鐨勫湴鍧,鎸囬拡鎸囧悜鍦板潃鐨勫?鎸囬拡鐨勫湴鍧\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">p1=%p    ,*p1=%d         ,&p1=%p</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,p1,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p1,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">p1); <br><br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n鎸囬拡鍔犱笂鏁存暟鐨勬晥鏋?鎸囬拡+int!=鎸囬拡錛屾寚閽?int==鍦板潃)錛歕n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">p1+4=%p,*(p1+4)=%d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,p1</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(p1</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">));<br>    <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">printf("&(p1+4)=%p",&(p1+4))</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">error:p1+4鏄竴涓湴鍧錛屼笉鑳藉鍏惰繘琛屽彇鍦板潃鎿嶄綔錛屼絾鍙互灝唒1+4璧嬬粰涓涓寚閽?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    <br>    p1</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">p++==p1+1銆俻1+1鏄竴涓湴鍧錛屽皢p1+1璧嬬粰p1</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n鍦╬1++浠ュ悗錛歕np1=%p    ,*p1=%d         ,&p1=%p\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,p1,</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p1,</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">p1);<br>    <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">姹備袱涓寚閽堝樊鍊?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\np2=%p,p1=%p,p2-p1=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,p2,p1,p2</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">p1); <br>    <br>    getchar();<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <img src ="http://m.shnenglu.com/liujiajia/aggbug/50421.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-19 19:08 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/19/50421.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>甯︽湁鏁扮粍綾誨瀷鍙傛暟鐨勫嚱鏁?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/16/50110.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Fri, 16 May 2008 15:54:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/16/50110.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/50110.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/16/50110.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/50110.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/50110.html</trackback:ping><description><![CDATA[<p>浼犻掓暟緇勫弬鏁幫紝鍏舵牳蹇冨氨鏄紶閫掕鏁扮粍鐨勯鍦板潃銆傜劧鍚庡嚱鏁板啀閫氳繃鏁扮粍銆佹寚閽堢瓑錛岀敤璇ユ暟緇勭殑棣栧湴鍧鏋勯犱竴涓柊鐨勬暟緇勬垨鎸囬拡錛屽啀閫氳繃浼犻掕繃鏉ョ殑鏁扮粍澶у皬錛屽璇ユ暟緇勮繘琛屾搷浣溿?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> SIZE 4</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbyarr(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a[],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n);<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbypointer(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n);<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbyaddress(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> address,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n);<br>int sumbypointer2(int *begin,int *end)<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[SIZE]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">20</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">30</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">};<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sum1;<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">浣跨敤鏁扮粍浣滀負褰㈠弬鎺ユ敹鏁扮粍 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    sum1</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">sumbyarr(arr,SIZE);<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the total of the arr by array is:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,sum1);<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">浣跨敤鎸囬拡浣滀負褰㈠弬鎺ユ敹鏁扮粍 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sum2;<br>    sum2</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">sumbypointer(arr,SIZE);<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the total of the arr by pointer is:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,sum2);<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">浣跨敤鍦板潃浣滀負褰㈠弬鎺ユ敹鏁扮粍 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sum3;<br>    sum3</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">sumbyaddress(arr,SIZE);<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">the total of the arr by address is:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,sum3);<br>       <br>    //浣跨敤涓や釜鎸囬拡褰㈠弬鎺ユ敹<br>    int sum4;<br>    sum4=sumbypointer2(arr,arr+SIZE);<br>    printf(<span style="COLOR: #000000">"</span><span style="COLOR: #000000">the total of the arr by pointer2 is:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,sum4);<br></span><br><br>    getchar();<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>} <br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbyarr(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> a[],</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n)<br>{ <br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> index;<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> total</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        total</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">a[index];<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> total;<br>}<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbypointer(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> index;<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> total</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">,p</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        total</span><span style="COLOR: #000000">+=*</span><span style="COLOR: #000000">p;<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> total;<br>}<br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> sumbyaddress(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> address,</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> n)<br>{<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">address;<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> index;<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> total</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">n;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">,p</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        total</span><span style="COLOR: #000000">+=*</span><span style="COLOR: #000000">p;<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> total;<br>}<br>int sumbypointer2(int *begin,int *end)<br>{<br>    int total=0;<br>    while(begin<end)<br>    {<br>        total+=*begin;<br>        begin++;<br>    }<br>    return total;<br>}</span></div> <br>浠ヤ笂浠g爜婕旂ず鎬庢牱瀹氫箟鏈夋暟緇勪綔涓哄弬鏁扮殑鍑芥暟銆?br>濡傛灉鏁扮粍浣滀負鍙傛暟浼犻掕繘鍏ユ煇涓嚱鏁幫紝騫朵笖鍦ㄨ繖涓嚱鏁頒腑鏀瑰彉浜嗘暟緇勫厓绱犵殑鍊鹼紝閭d箞紼嬪簭榪斿洖鍚庯紝榪欎釜鏁扮粍鍏冪礌鐨勫兼湁娌℃湁鏀瑰彉鍛紵<br><br>褰撶劧錛屽兼敼鍙樹簡錛屽洜涓烘暟緇勬槸閫氳繃鍦板潃浼犻掔殑錛屾敼鍙樹簡琚皟鍑芥暟涓暟緇勭殑鍊間篃灝辨剰鍛崇潃鍚屾椂鏀瑰彉浜嗕富璋冨嚱鏁頒腑鏁扮粍鐨勫箋傚洜涓哄畠浠殑鍦板潃鏄浉鍚岀殑銆? <img src ="http://m.shnenglu.com/liujiajia/aggbug/50110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-16 23:54 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/16/50110.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁よ瘑鏁扮粍鍜屾寚閽堢殑鍏崇郴http://m.shnenglu.com/liujiajia/archive/2008/05/16/50097.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 16 May 2008 13:30:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/16/50097.htmlhttp://m.shnenglu.com/liujiajia/comments/50097.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/16/50097.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/50097.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/50097.html    int arr[SIZE]={1,2,3,4};
    int index;
    for(index=0;index<SIZE;index++)
    {
        printf("arr[%d]=%d address=%p\n",index,arr[index],arr+index);
    }
   
    int *p=arr;
    for(index=0;index<SIZE;index++)
    {
        printf("*(p+%d)=%d     p+%d=%p\n",index,*(p+index),index,p+index);
    }
   
    getchar();
    return 0;

浠ヤ笂浠g爜灞曠ず浜嗚鍙栨暟緇勪腑鍏冪礌鐨勪袱縐嶆柟寮忥紝絎竴縐嶆槸甯歌鐨勪嬌鐢ㄦ暟緇勪笅鏍囨潵璇誨彇銆傜浜岀鏂規硶鏄嬌鐢ㄦ寚閽堟潵璇誨彇鏁扮粍銆?br>
閫氳繃絎竴涓柟娉曚腑鎵撳嵃鍑烘潵鐨勫唴瀹癸紝鎴戜滑鍙互璁よ瘑鍒幫紝鏁扮粍鍚嶅叾瀹炲氨鏄繖涓暟緇勭殑棣栧湴鍧錛屽嵆錛歛rr=鏁扮粍棣栧湴鍧;arr+1:鏁扮粍絎簩涓厓绱犵殑鍦板潃錛沘rr+2錛氭暟緇勭涓変釜鍏冪礌鐨勫湴鍧錛屼互姝ょ被鎺ㄣ傘傘?br>
絎簩縐嶆柟娉曟垜浠嬌鐢ㄦ寚閽堣闂唬鏇夸簡鏁扮粍涓嬫爣璁塊棶錛屾垜浠皢 arr(鍗蟲暟緇勭殑棣栧湴鍧)璧嬪肩粰浜嗘寚閽?*p錛屾墍浠?p灝辯瓑浜巃rr鐨勯鍦板潃錛宲+1灝辯瓑浜巃rr鐨勪簩涓厓绱犵殑鍦板潃錛岄偅涔?p灝辯浉褰撲簬浜哸rr[0],*(p+1)灝辯浉褰撲簬arr[1]銆?br>
鎴戜滑浠庝腑鍙互寰楀嚭涓涓粨璁猴細鏁扮粍鏍囪瀹為檯涓婃槸涓縐嶅彉鐩鎬嬌鐢ㄦ寚閽堢殑褰㈠紡銆?

]]>
浜岀淮鏁扮粍綆鍗曚嬌鐢?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/16/49998.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Thu, 15 May 2008 16:06:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/16/49998.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/49998.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/16/49998.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/49998.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/49998.html</trackback:ping><description><![CDATA[<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> PLAYER 4</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> MATCH 3</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">灝?鍚嶇悆鍛樿繎涓夊満姣旇禌鐨勫緱鍒嗗垵濮嬪寲</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arrmark[MATCH][PLAYER]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{<br>        {</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">},<br>        {</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">},<br>        {</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">}<br>        }; <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">杈撳嚭鍏蜂綋鎴愮嘩</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> i,j;<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">***********Roony  Ronaldo  Kaka  Grosso\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">MATCH;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">match%d:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,i);<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">PLAYER;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%8d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,arrmark[i][j]);<br>        }<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    }<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎵撳嵃鎬誨垎</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> temp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">total        </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;i</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">PLAYER;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)   </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">姹傛瘡涓悆鍛樼殑鎬誨垎 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    {<br>        </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;j</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">MATCH;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>        {<br>            temp</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">arrmark[j][i];<br>        }<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%d      </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,temp);<br>        temp</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>    } <br>    getchar();<br>} </span></div> <img src ="http://m.shnenglu.com/liujiajia/aggbug/49998.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-16 00:06 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/16/49998.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎸囧畾鏁扮粍澶у皬http://m.shnenglu.com/liujiajia/archive/2008/05/15/49996.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Thu, 15 May 2008 15:32:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/15/49996.htmlhttp://m.shnenglu.com/liujiajia/comments/49996.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/15/49996.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/49996.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/49996.html    char arr[10];                                     //OK
    char arr2[1+2*7];                            //OK
    char arr3[sizeof(char)+2];                //OK
    char arr4[-2];                                  //error 鏁扮粍澶у皬涓嶈兘浣跨敤璐熸暟
    char arr5[0];                                   //鏍規嵁緙栬瘧鍣ㄤ笉鍚岋紝鏈夌殑緙栬瘧鍣ㄨ漿鎹負“arr5[]”,鏈夌殑緙栬瘧涓嶉氳繃銆?/span>
    char arr6[3.14];                              //error
    char arr7[(int)3.14];                       //寮哄埗杞崲涓篿nt
    int m=2;
    char arr9[m];                                //c99鍓嶄笉鍏佽

娉ㄦ剰錛歝99鏍囧噯鍏佽浣跨敤鍙橀噺鎸囧畾鏁扮粍澶у皬銆?

]]>
璁よ瘑鏁扮粍涔嬫暟緇勭殑鍒濆鍖?/title><link>http://m.shnenglu.com/liujiajia/archive/2008/05/15/49994.html</link><dc:creator>鍒樺姞鍔?/dc:creator><author>鍒樺姞鍔?/author><pubDate>Thu, 15 May 2008 15:11:00 GMT</pubDate><guid>http://m.shnenglu.com/liujiajia/archive/2008/05/15/49994.html</guid><wfw:comment>http://m.shnenglu.com/liujiajia/comments/49994.html</wfw:comment><comments>http://m.shnenglu.com/liujiajia/archive/2008/05/15/49994.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/liujiajia/comments/commentRss/49994.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/liujiajia/services/trackbacks/49994.html</trackback:ping><description><![CDATA[浠ヤ笅浠g爜灞曠ず鏁扮粍鍒濆鍖栫殑鍚勭鎯呭喌錛?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">#define</span><span style="COLOR: #000000"> SIZE 4</span><span style="COLOR: #000000"><br></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main(</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">)<br>{<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">涓鑸垵濮嬪寲 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr[SIZE]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">};<br>    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> index;<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SIZE;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        arr[index]</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">arr[%d]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,index,arr[index]);<br>    }<br>    <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">瀹氫箟騫跺垵濮嬪寲涓涓猚onst鏁扮粍銆傛暟緇勫唴鍏冪礌涓嶈兘淇敼 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> arr2[SIZE]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">};<br>    <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏁扮粍涓嶅垵濮嬪寲錛屽厓绱犵殑鍊間負闅忔満鏁般?nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr3[SIZE];  <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SIZE;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">arr3[%d]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,index,arr3[index]);<br>    }<br><br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鍒濆鍖栨暟緇勪腑閮ㄥ垎鍏冪礌錛屽叾浠栧厓绱犲垯琚垵濮嬪寲涓? </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr4[SIZE]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">}; <br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SIZE;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">arr4[%d]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,index,arr4[index]);<br>    }<br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎸囧畾瑕佸垵濮嬪寲鐨勫厓绱?/span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr5[SIZE]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">,[</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">};<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SIZE;index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">arr5[%d]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,index,arr5[index]);<br>    }<br>    <br>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏁扮粍鐨勫厓绱犱釜鏁頒笉鍥哄畾 </span><span style="COLOR: #008000"><br></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> arr6[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">};<br>    printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">sizeof arr6=%d,sizeof arr6[0]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000"> arr6,</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000"> arr6[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]);<br>    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(index</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;index</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000"> arr6</span><span style="COLOR: #000000">/</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000"> arr6[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">];index</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br>    {<br>        printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">arr6[%d]=%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,index,arr6[index]);<br>    }<br>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br>}</span></div> <br>紼嬪簭榪愯緇撴灉鏄細<br><img height=426 alt="" src="http://m.shnenglu.com/images/cppblog_com/liujiajia/arrinit.jpg" width=284 border=0><br>鎬庝箞鏍鳳紵鏁扮粍鐨勫垵濮嬪寲鏂瑰紡澶氱澶氭牱銆備絾瑕佺伒媧昏繍鐢ㄣ? <img src ="http://m.shnenglu.com/liujiajia/aggbug/49994.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/liujiajia/" target="_blank">鍒樺姞鍔?/a> 2008-05-15 23:11 <a href="http://m.shnenglu.com/liujiajia/archive/2008/05/15/49994.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁よ瘑sizeofhttp://m.shnenglu.com/liujiajia/archive/2008/05/15/49942.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Thu, 15 May 2008 08:01:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/15/49942.htmlhttp://m.shnenglu.com/liujiajia/comments/49942.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/15/49942.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/49942.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/49942.html浠ヤ笅浠g爜婕旂ずsizeof鐢ㄦ硶錛?br>
#include<stdio.h>
#include
<stddef.h> 
#include
<stdlib.h>
int main(void)
{
    
int i;
    printf(
"sizeof(2008)=%d\n",sizeof(2008));
    printf(
"sizeof(i)=%d\n",sizeof(i));
    printf(
"sizeof i=%d\n",sizeof i);
    printf(
"sizeof(int)=%d\n",sizeof(int));
    
//printf("sizeof int=%d\n",sizeof int); //sizeof int鍐欐硶閿欒錛?nbsp;
    printf("sizeof(char)=%d\n",sizeof(char));
    printf(
"sizeof(float)=%d\n",sizeof(float));
    printf(
"sizeof(double)=%d\n",sizeof(double));
    
    
return 0;
}

榪愯緇撴灉鏄劇ず錛?br>

鍙﹀錛宻izeof 鍙互搴旂敤浜庢暟緇勩佺粨鏋勭瓑鎯呭喌錛岃鍙傝冭繖綃囨枃绔狅細http://blog.chinaunix.net/u/20828/showart_438003.html

]]>
璁よ瘑閫掑綊鍑芥暟http://m.shnenglu.com/liujiajia/archive/2008/05/14/49769.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Tue, 13 May 2008 16:08:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/14/49769.htmlhttp://m.shnenglu.com/liujiajia/comments/49769.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/14/49769.html#Feedback0http://m.shnenglu.com/liujiajia/comments/commentRss/49769.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/49769.html#include<stdio.h>
void testfunc(int);
int main(void)
{
    testfunc(
1);
    
return 0;
}
void testfunc(int n)
{
    printf(
"Lv%d:%p\n",n,&n); //%p 鍦板潃鏄劇ず鏍煎紡
    if(n<4)
    {
        testfunc(n
+1);  //testfunc()璋冪敤浜嗚嚜宸?/span>
    }
    printf(
"2Lv%d:%p\n",n,&n);
}
浠ヤ笂鏄竴涓掑綊鐨勭ず渚嬨?br>testfunc()鍦ㄥ唴閮ㄨ皟鐢ㄤ簡鑷繁錛岃繖鏍風殑鍚庢灉鏄細鏆傛椂涓嶆墽琛屾渶鍚庨潰鐨?#8220;printf("2Lv%d:%p\n",n,&n);”錛岃屾槸灝?n+1浣滀負鍙傛暟璋冪敤浜嗚嚜宸憋紝榪欐牱閲嶅錛屾渶緇堢▼搴忕殑緇撴灉鏄細

(鏍規嵁鐢佃剳涓嶅悓錛屽湴鍧鍙兘鏈夋墍涓嶅悓)
紼嬪簭鍏蜂綋榪愯姝ラ錛?br>1.main()璋冪敤testfunc(1)
2.testfunc(1)鎵ц錛屾墦鍗?#8220;lv1:0022FF60”錛?022FF60鏄痭鐨勫湴鍧
3.n<4,鏉′歡鎴愮珛錛?nbsp;testfunc(1)璋冪敤testfunc(2)
4.testfunc(2)鎵ц錛屾墦鍗?#8220;lv1:0022FF40”,鍥犱負姝ゆ椂testfunc(2)鐨勫彉閲弉宸茬粡涓嶆槸testfunc(1)涓殑鍙橀噺n浜嗭紝鎵浠ュ湴鍧涓嶅悓銆傦紙鍑芥暟鐨勫弬鏁頒綔鐢ㄥ煙鍙湪褰撳墠鍑芥暟錛?br>5.n<4錛屾潯浠舵垚绔嬶紝testfunc(2)璋冪敤testfunc(3)
6.testfunc(3)鎵ц錛屾墦鍗?#8220;lv1:0022FF20”
7.n<4錛屾潯浠舵垚绔嬶紝testfunc(3)璋冪敤testfunc(4)
8.testfunc(4)鎵ц錛屾墦鍗?#8220;lv1:0022FF00”
9.n<4,鏉′歡涓嶆垚绔嬶紝鎵撳嵃“2lv1:0022FF00”
10.榪斿洖璋冪敤testfunc(4)鐨則estfunc(3),鎵撳嵃“2lv1:0022FF20”
11.榪斿洖璋冪敤testfunc(3)鐨則estfunc(2),鎵撳嵃“2lv1:0022FF40”
12.榪斿洖璋冪敤testfunc(2)鐨則estfunc(1),鎵撳嵃“2lv1:0022FF60”

OK,榪欏氨鏄嚱鏁扮殑閫掑綊璋冪敤錛岄氫織鐨勮灝辨槸鍑芥暟鑷繁璋冪敤鑷繁銆備互鍓嶅鏃舵病鏈夊紕鏄庣櫧錛岀幇鍦ㄧ粓浜庡紕鏄庣櫧浜嗐?br>

]]>
璁よ瘑getchar()鍜宲utchar()http://m.shnenglu.com/liujiajia/archive/2008/05/09/49367.html鍒樺姞鍔?/dc:creator>鍒樺姞鍔?/author>Fri, 09 May 2008 14:55:00 GMThttp://m.shnenglu.com/liujiajia/archive/2008/05/09/49367.htmlhttp://m.shnenglu.com/liujiajia/comments/49367.htmlhttp://m.shnenglu.com/liujiajia/archive/2008/05/09/49367.html#Feedback2http://m.shnenglu.com/liujiajia/comments/commentRss/49367.htmlhttp://m.shnenglu.com/liujiajia/services/trackbacks/49367.htmlch=getchar(); 鍜?scanf("%c",&ch);鏄悓鏍風殑鏁堟灉銆?br>

putchar()鍑芥暟鐢ㄦ潵鎵撳嵃瀹冪殑鍙傛暟銆?br>putchar(ch); 鍜?printf("%c",ch); 鏄悓鏍風殑鏁堟灉銆?br>
榪欎袱涓嚱鏁伴兘鍦?stdio.h 鏂囦歡涓畾涔変簡銆?



]]>
伊人久久综合成人网| 久久国产乱子伦精品免费强| 久久夜色精品国产亚洲| 久久国产高潮流白浆免费观看| 国产精品一久久香蕉产线看| 国内精品久久久久久久亚洲| 久久久久久久久久久精品尤物| 国内精品久久久久久99| 日韩AV毛片精品久久久| 国产午夜久久影院| 少妇熟女久久综合网色欲| 伊人久久大香线焦综合四虎| 伊人久久综合精品无码AV专区| 国产精品成人久久久久三级午夜电影 | 久久综合噜噜激激的五月天| 亚洲国产精品一区二区久久| 日韩人妻无码一区二区三区久久99| 久久精品国产亚洲综合色| 亚洲人成精品久久久久| 久久精品国产亚洲一区二区三区| 精品久久久久久无码专区| 久久久久久亚洲精品影院| 国产成人久久精品麻豆一区| 午夜人妻久久久久久久久| 国产精品亚洲综合久久| 国产亚洲精久久久久久无码AV| 久久综合国产乱子伦精品免费| 久久亚洲sm情趣捆绑调教| 国产精品久久久久蜜芽| 性高朝久久久久久久久久| 久久精品成人免费国产片小草| 久久综合丝袜日本网| 欧美激情精品久久久久| 丁香五月网久久综合| 精品熟女少妇a∨免费久久| 青草国产精品久久久久久| 中文字幕无码免费久久| 一本色综合网久久| 久久99国产综合精品| 国产精品久久久亚洲| 久久免费视频观看|