锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产第一区二区三区,精品人妻伦九区久久AAA片69,久久久噜噜噜久久中文字幕色伊伊http://www.shnenglu.com/lazz/category/9852.htmlzh-cnThu, 11 Jun 2009 08:45:31 GMTThu, 11 Jun 2009 08:45:31 GMT60鍏充簬鏃犱復鏃跺彉閲忕殑鍙橀噺鍊間氦鎹㈢殑璁板綍 && 姹傛渶澶ц〃紺烘暟http://www.shnenglu.com/lazz/archive/2009/06/11/87410.html钃濆皹钃濆皹Thu, 11 Jun 2009 07:15:00 GMThttp://www.shnenglu.com/lazz/archive/2009/06/11/87410.htmlhttp://www.shnenglu.com/lazz/comments/87410.htmlhttp://www.shnenglu.com/lazz/archive/2009/06/11/87410.html#Feedback0http://www.shnenglu.com/lazz/comments/commentRss/87410.htmlhttp://www.shnenglu.com/lazz/services/trackbacks/87410.html涓嶇敤涓存椂鍙橀噺榪涜鏁村瀷鍙橀噺浜ゆ崲"

涓ょ嫻佽鏂規硶:
(1) 鍔犲噺鍑?br>
1 void AsExchang(int &x, int &y)
2 {
3      x = x + y;
4      y = x - y;
5      x = x - y;
6 }
7 

(2) 寮傛垨
1 void XorExchang(int &x, int &y)
2 {
3      x = x ^ y;
4      y = x ^ y;
5      x = x ^ y;
6 }

涓ょ鏂規硶, 閮藉彲浠ヨ璇嗘槸瀵嗙爜瀛︾殑涓閮ㄥ垎鍚? 鍙槸鐢ㄥ姞鍑忔硶鏉ュ姞瀵? 騫肩涓旂己涔忓畨鍏ㄦц屽凡.
褰撶劧, 寮傛垨娉曞湪鐜板疄涓篃寰楀彉縐嶆墠鑳藉疄闄呭簲鐢?br>
涓寮濮嬪偦鍌誨湴鑱旀兂鍒版柟娉曚竴鏄惁瀛樺湪瓚婄晫闂... //鍩虹鐭ヨ瘑鐬棿钖勫急鍖?..
緋葷粺搴曞眰鐨勫疄鐜板眳鐒朵竴鏃墮棿蹇樿浜?..

鑱旀兂鍒板浣曠‘璁や竴涓被鍨嬭兘琛ㄧず鐨勬渶澶ф渶灝忓?br>(1)
鎵浠ユ兂鍒扮殑鐢╯izeof榪愮畻絎? 鍒ゆ柇綾誨瀷鐨勪綅鏁? 鐒跺悗絎ㄧ鍦板乏縐誨彸縐繪搷浣滆繘琛岃綆?br>
int getMaxInt()
{
    
int iBase= 1;
    
const int IntSize = sizeof(int* 8;

    
//int鏄湁絎﹀彿鏁? 鏈宸﹁竟涓浣嶆槸絎﹀彿浣?br>    //so
    for(int i = 1; i < IntSize - 1 ; i++ )
    {
        iBase 
= (iBase << i) + 1;
    }

    
return iBase; 
}
濂界鐨勬柟娉?..
寰堟病鏁堢巼

(2)
鐢ㄥ己鍒惰漿鎹㈠惂, (int)0x*,
*鏄粈涔? 0x7fffffff
鎭跺績-_-||, 鎴戜竴寮濮嬪張4涓猣浜? 涓涓猣鎵?浣嶅惂...

(3)
榪樻湁鐢╞itset, bitsit鏈塼o_ulong鏂規硶, 鍑戝悎鐫鐢?br>
(4)
climits鐨?INT_MAX
鍦╟plusplus.com涓婇潰鐨剅eference鏄樉紺?br>
INT_MAX  Maximum value for an object of type int
 = 32767
琚粬鐨勫浘琛ㄩ獥浜?br>
VC6鐗堟湰鐨勫ご鏂囦歡閲岄潰鏄敤
#define INT_MAX  2147483647 
鐩存帴瀹氫箟鐨?br>鏌ョ湅cywin閲岄潰鐨勫ご鏂囦歡
涔熷樊涓嶅..
#define __INT_MAX__ 2147483647
#define INT_MAX __INT_MAX__


(5)
C++鏍囧噯鏂規硶..
//鐩存帴璐磋繃鏉ヤ簡
//鍓嶉潰鏈夎鏄庤numeric_limits<int>::max()絳変簬INT_MAX
//... 鍙槸灝佽浜嗘ā鏉胯屽凡
 1 // numeric_limits example
 2 #include <iostream>
 3 #include <limits>
 4 using namespace std;
 5 
 6 int main () {
 7   cout << boolalpha;
 8   cout << "Minimum value for int: " << numeric_limits<int>::min() << endl;
 9   cout << "Maximum value for int: " << numeric_limits<int>::max() << endl;
10   cout << "int is signed: " << numeric_limits<int>::is_signed << endl;
11   cout << "Non-sign bits in int: " << numeric_limits<int>::digits << endl;
12   cout << "int has infinity: " << numeric_limits<int>::has_infinity << endl;
13   return 0;
14 }



娌″幓鎵鵑珮鎵嬩滑鐨勫鎷? 嫻氮鑽¤崱鍙堟秷璐逛簡涓嶅皯鏃墮棿...
緇х畫娼滀慨鍘?br>


钃濆皹 2009-06-11 15:15 鍙戣〃璇勮
]]>
鍏充簬c++瀵硅薄鍏ㄥ眬瀵硅薄鏋愭瀯鐨勫嚑鐐硅褰?/title><link>http://www.shnenglu.com/lazz/archive/2009/02/25/74904.html</link><dc:creator>钃濆皹</dc:creator><author>钃濆皹</author><pubDate>Wed, 25 Feb 2009 12:35:00 GMT</pubDate><guid>http://www.shnenglu.com/lazz/archive/2009/02/25/74904.html</guid><wfw:comment>http://www.shnenglu.com/lazz/comments/74904.html</wfw:comment><comments>http://www.shnenglu.com/lazz/archive/2009/02/25/74904.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/lazz/comments/commentRss/74904.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lazz/services/trackbacks/74904.html</trackback:ping><description><![CDATA[<div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include</span><span style="color: #000000;"><</span><span style="color: #000000;">iostream</span><span style="color: #000000;">></span><span style="color: #000000;"><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> std::cout;<br></span><span style="color: #0000ff;">using</span><span style="color: #000000;"> std::endl;<br></span><span style="color: #0000ff;">class</span><span style="color: #000000;"> CDust{<br></span><span style="color: #0000ff;">public</span><span style="color: #000000;">:<br>    CDust()<br>    {<br>        cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> CDust constructor </span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;"><<</span><span style="color: #000000;"> endl;<br>    }<br><br>    </span><span style="color: #000000;">~</span><span style="color: #000000;">CDust()<br>    {<br><br>        cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> ~CFoo destructor </span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;"><<</span><span style="color: #000000;"> endl;<br>    }<br>};<br><br><br>CDust A;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main()<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> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">鎴戞兂綾諱技鐨勪唬鐮佸湪緗戜笂Google涓嬪簲璇ユ湁涓嶅皯</div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">灝濊瘯浜嗕笅,鍦╲c6.0鐨勬儏鍐典笅,鏄病鏈夎緭鍑?"~CFoo destructor", 浣嗚繖騫朵笉浠h〃 ~CDust() 娌℃湁鎵ц.</div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">鍦▇CDust閲岄潰璁劇疆鏂偣,浼氬彂鐜頒簨瀹炰笂紼嬪簭榪愯鏃惰繘鍏ヤ簡鏋愭瀯鍑芥暟閲? // -_! 琛ㄨ揪濂界壍寮?/div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">鏈潵鎯沖疄鍦ㄨ窡韙繖閲屽紑濮嬬▼搴忓彂鐢熶簡浠涔堣皟鐢ㄤ簡浠涔?鍙戠幇鍔熷簳涓嶈凍,瀹屽叏涓嶆槑鐧?灝卞厛鎵撴柇浜?/div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">鑰屽啀鍦? return 0 ' 璇彞鍓嶉潰鍔犱笂鏂偣,浼氱湅鍒拌繖涓柊鍔犵殑鏂偣姣旀瀽鏋勯噷闈㈢殑鏂偣鍏堝埌杈?... </div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">浠ョ幇鍦╟++鐨勯犺鍜寁c6.0鐨勪簡瑙f儏鍐墊潵鐪?澶寸棝浜?/div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">涓轟粈涔?return 0 鍚庣▼搴忎笉鏄甯哥粨鏉熶簡鎵嶅幓鎵ц 鍏ㄥ眬瀵硅薄鐨勬瀽鏋?</div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;"><br></div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">鏀瑰啓涓嬩唬鐮?br></div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;"> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include</span><span style="color: #000000;"><</span><span style="color: #000000;">iostream.h</span><span style="color: #000000;">></span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">class</span><span style="color: #000000;"> CDust{<br></span><span style="color: #0000ff;">public</span><span style="color: #000000;">:<br>    CDust()<br>    {<br>        cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> CDust constructor </span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;"><<</span><span style="color: #000000;"> endl;<br>    }<br><br>    </span><span style="color: #000000;">~</span><span style="color: #000000;">CDust()<br>    {<br><br>        cout </span><span style="color: #000000;"><<</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> ~CFoo destructor </span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;"><<</span><span style="color: #000000;"> endl;<br>    }<br>};<br><br><br>CDust A;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;"> main()<br>{<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><br>}</span></div> <br></div> <div style="padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; width: 98%;">榪欐牱鐢ㄦ棫鐗堟湰鐨勫ご鏂囦歡瀹炵幇,鎺у埗鍙拌緭鍑轟簡鎰忓鐨勪袱涓皟鐢?--- 鏋愭瀯鍑芥暟杈撳嚭鏄劇ず浜?.<br><br>鏄痗out鍦ㄥご鏂囦歡鐨勫疄鐜版柟寮忎笉鍚?<br><br>鍦╠ev-c++閲岄潰,榪愯絎竴浠d唬鐮?br>鏍規嵁鏂偣鐨勮緗祴璇?涔熸槸鍏堟墽琛屼簡 main()鍑芥暟閲岄潰鐨?return 0 鎵嶈繘鍏ュ叏灞鍑芥暟鐨勬瀽鏋?涔熻兘鍙戠幇鏋愭瀯鍑芥暟閲岄潰鐨勮緭鍑鴻璋冪敤浜?鎺у埗鍙版湁鏄庣‘鐨勬樉紺?br>榪欐牱涓鏉?鍙堜笉鏄庣櫧浜?..<br>鍦╲c6.0閲岄潰涓轟粈涔堟墽琛屼簡鍏ㄥ眬鍑芥暟鐨勬瀽鏋勫嵈娌℃湁鎵璋撶殑杈撳嚭?<br>鏄洜涓篶md鎺у埗鍙板湪'return 0'紼嬪簭鏉冮檺鏀跺洖  // 濂藉儚鎵埌緋葷粺鐨勪竴浜涙販涔辯殑鏃ц蹇嗕簡...<br><br>緗戞父浜嗕竴涓?br>鎵懼埌鏆傛椂姣旇緝娓呮櫚鐨勮娉曟槸:<br>   In C++, the constructor of a global object is executed before the main() function(of course after the STARTUP code), while the destructor <br> is invoked after the main() function. So in my humble opinion, the main() function is a bridge between the constructor and the destructor.Further more, the constructor and the destructor is the actual manager of the whole program, because they can manage all the<br> resources of the program(for instance, the constructor allocate memory units and the destructor free them.I'am not sure of this, any comments will be appreciated in advance.).<br> 4)In C++, is it true that the resources obtained during the constructor and the destructor (both belong to a global object)are managed by themselves and have nothing with the main() function.Therfore, I think the main() function is not the king in C++ as it is in C.  <br>   //鎰熻阿鎻愬嚭姝よ娉曠殑鏈嬪弸<br> <br>  _startup鎵嶆槸鐢ㄦ埛紼嬪簭鐨勮搗鐐瑰拰緇堢偣? 鐨勭‘,璋冪敤_exit()鍑芥暟鍐嶆柇鐐規祴璇?鍏ㄥ眬瀵硅薄鐨刣estructor鏄病鏈夎繘鍏ョ殑鏈轟細   //闀胯璇嗕簡<br><br>  灝辨鍏堟墦鏂?.. 鍐嶆繁鍏ヤ粖鏅氬氨榪欐牱瀹屼簡.<br>  灝辨璁板綍涓?浠ュ悗鍐嶆帴瑙?br> <br><br><br>涓嶅皬蹇冨張鎺ヨЕ浜?..<br>鎳掑緱寮鏂扮殑灝遍泦涓湪榪欓噷鍚?br><br>鍦╩ain()閲岄潰鎵嬪姩璋冪敤鍏ㄥ眬瀵硅薄鐨勬瀽鏋? 鏈鍚庣▼搴忛兘浼氭墽琛屼袱嬈℃瀽鏋勮皟鐢?.. 鍦?lt;iostream.h>鐨刢out榪欑鎯呭喌涓嬫槑鏄?鍦╯td::cout涓嬭繕寰楅潬鏂偣璁劇疆鎵嶈兘浣撶幇鍒?vc6鐨勬儏鍐?<br>     榪欓噷鏄竴縐嶈В鏋?br>     {<br>      Once a <strong class="highlight">destructor is invoked for an object, the object no longer exists; the behavior is undefined if the <strong class="highlight">destructor is invoked for an object whose lifetime has ended. [Example: if the <strong class="highlight">destructor for an automatic object is explicitly invoked, and the block is subsequently left in a manner that would ordinarily invoke implicit destruction of the object, the behavior is undefined </strong></strong></strong><br>}<br>     闈瀏lobal static object 涔熶細鍑虹幇涓ゆ璋冪敤, 鍖哄埆鍙湪涓庝竴涓湪main() 閫鍑轟箣鍓?涓涓湪涔嬪悗...<br>(鐨勭‘,鎵嬪伐璋冪敤鏋愭瀯鍑芥暟鐨勬儏鍐靛緢灝戝嚭鐜?nbsp; -_! )<br>     濡傛灉鎴戝湪鏋愭瀯閲岄潰瀛樺湪 閲婃斁鍐呭瓨 榪欎竴綾誨疄鐜? 閭g浜屾鍐嶆閲婃斁涓嶆槸瀹規槗鍑洪棶棰?!! <br>     浠ュ悗閬囧埌榪欑鎯呭喌寰楁敞鎰忔嫻嬩唬鐮佺殑娣誨姞...<br><br></div><img src ="http://www.shnenglu.com/lazz/aggbug/74904.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lazz/" target="_blank">钃濆皹</a> 2009-02-25 20:35 <a href="http://www.shnenglu.com/lazz/archive/2009/02/25/74904.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.dgdike.cn" target="_blank">色婷婷久久综合中文久久蜜桃av</a>| <a href="http://www.wuchui.cn" target="_blank">久久久久亚洲av无码专区喷水 </a>| <a href="http://www.zjjunyao.cn" target="_blank">久久综合狠狠综合久久综合88</a>| <a href="http://www.hunxiaodansang.cn" target="_blank">日产久久强奸免费的看</a>| <a href="http://www.jswlgs.cn" target="_blank">噜噜噜色噜噜噜久久</a>| <a href="http://www.nzlx.cn" target="_blank">国产综合久久久久</a>| <a href="http://www.zhy-gl.cn" target="_blank">久久九九久精品国产免费直播</a>| <a href="http://www.shlinfeng.com.cn" target="_blank">色诱久久av</a>| <a href="http://www.yaojk.cn" target="_blank">国产精品久久久久久久久</a>| <a href="http://www.hlccbxw.cn" target="_blank">久久一区二区免费播放</a>| <a href="http://www.shangzhew.cn" target="_blank">少妇内射兰兰久久</a>| <a href="http://www.gljqk.cn" target="_blank">精品久久久久久无码中文野结衣</a>| <a href="http://www.ahlgw.cn" target="_blank">99久久精品免费看国产一区二区三区 </a>| <a href="http://www.jmjxmt.cn" target="_blank">久久精品一区二区</a>| <a href="http://www.mashar.cn" target="_blank">亚洲婷婷国产精品电影人久久</a>| <a href="http://www.reboc.cn" target="_blank">少妇久久久久久久久久</a>| <a href="http://www.taiguolu.com.cn" target="_blank">精品久久久无码中文字幕</a>| <a href="http://www.knnnb.cn" target="_blank">久久人人爽人人爽人人AV东京热 </a>| <a href="http://www.tianlaiedu.cn" target="_blank">久久精品中文无码资源站</a>| <a href="http://www.lozhun.cn" target="_blank">久久97精品久久久久久久不卡</a>| <a href="http://www.hhhkk.cn" target="_blank">人人妻久久人人澡人人爽人人精品 </a>| <a href="http://www.beidoukemao.cn" target="_blank">久久亚洲综合色一区二区三区</a>| <a href="http://www.zhijin168.com.cn" target="_blank">久久精品成人欧美大片</a>| <a href="http://www.itkuo.cn" target="_blank">国内精品久久久久久99蜜桃 </a>| <a href="http://www.veemei.com.cn" target="_blank">久久香蕉国产线看观看精品yw</a>| <a href="http://www.9r6.com.cn" target="_blank">女同久久</a>| <a href="http://www.gzsaikou.cn" target="_blank">久久99久久成人免费播放</a>| <a href="http://www.manour.cn" target="_blank">久久国产精品-久久精品</a>| <a href="http://www.splh.net.cn" target="_blank">久久久久久无码Av成人影院</a>| <a href="http://www.ebianlian.cn" target="_blank">久久综合久久综合亚洲</a>| <a href="http://www.lntyyp.cn" target="_blank">婷婷国产天堂久久综合五月</a>| <a href="http://www.lishi5.cn" target="_blank">欧美久久综合九色综合</a>| <a href="http://www.x705.cn" target="_blank">久久国产综合精品五月天</a>| <a href="http://www.uutools.cn" target="_blank">国产成人久久精品麻豆一区</a>| <a href="http://www.k7yg835v.cn" target="_blank">av无码久久久久久不卡网站</a>| <a href="http://www.zhongshengwsl.cn" target="_blank">蜜臀av性久久久久蜜臀aⅴ</a>| <a href="http://www.duange.com.cn" target="_blank">狠狠综合久久综合88亚洲 </a>| <a href="http://www.joyitsai.cn" target="_blank">亚洲中文久久精品无码ww16</a>| <a href="http://www.xahyjtls.cn" target="_blank">久久伊人五月丁香狠狠色</a>| <a href="http://www.tvauto.cn" target="_blank">婷婷久久综合</a>| <a href="http://www.wangyanl3.com.cn" target="_blank">久久精品国产乱子伦</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>