锘??xml version="1.0" encoding="utf-8" standalone="yes"?>99re66热这里只有精品4,蜜臀久久99精品久久久久久9,在线中文字幕一区http://www.shnenglu.com/jack-wang/category/10923.html灝忕帇zh-cnMon, 11 Mar 2024 08:41:06 GMTMon, 11 Mar 2024 08:41:06 GMT60緙栬瘧鎶ラ敊錛?lib/../lib64/crt1.o錛氬湪鍑芥暟鈥榑start鈥欎腑(.text+0x20)瀵光榤ain鈥欐湭瀹氫箟鐨勫紩鐢?collect2: error: ld returned 1exit statushttp://www.shnenglu.com/jack-wang/archive/2024/03/05/230298.html灝忕帇灝忕帇Tue, 05 Mar 2024 04:18:00 GMThttp://www.shnenglu.com/jack-wang/archive/2024/03/05/230298.htmlhttp://www.shnenglu.com/jack-wang/comments/230298.htmlhttp://www.shnenglu.com/jack-wang/archive/2024/03/05/230298.html#Feedback0http://www.shnenglu.com/jack-wang/comments/commentRss/230298.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/230298.html

灝忕帇 2024-03-05 12:18 鍙戣〃璇勮
]]>
灝忔暟鐐瑰悗淇濈暀N浣?/title><link>http://www.shnenglu.com/jack-wang/archive/2022/10/20/229446.html</link><dc:creator>灝忕帇</dc:creator><author>灝忕帇</author><pubDate>Thu, 20 Oct 2022 07:34:00 GMT</pubDate><guid>http://www.shnenglu.com/jack-wang/archive/2022/10/20/229446.html</guid><wfw:comment>http://www.shnenglu.com/jack-wang/comments/229446.html</wfw:comment><comments>http://www.shnenglu.com/jack-wang/archive/2022/10/20/229446.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jack-wang/comments/commentRss/229446.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jack-wang/services/trackbacks/229446.html</trackback:ping><description><![CDATA[<div>灝忔暟鐐瑰悗淇濈暀2浣嶆暟錛?br /><br />float x = 100.1234;</div><div>char buf[8] = { 0 };</div><div>::sprintf(buf, "%0.2lf", x);</div><img src ="http://www.shnenglu.com/jack-wang/aggbug/229446.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jack-wang/" target="_blank">灝忕帇</a> 2022-10-20 15:34 <a href="http://www.shnenglu.com/jack-wang/archive/2022/10/20/229446.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>CMake鎶ラ敊錛?STREQUAL" "x86_64" Unknown arguments specifiedhttp://www.shnenglu.com/jack-wang/archive/2021/12/22/217888.html灝忕帇灝忕帇Wed, 22 Dec 2021 08:24:00 GMThttp://www.shnenglu.com/jack-wang/archive/2021/12/22/217888.htmlhttp://www.shnenglu.com/jack-wang/comments/217888.htmlhttp://www.shnenglu.com/jack-wang/archive/2021/12/22/217888.html#Feedback0http://www.shnenglu.com/jack-wang/comments/commentRss/217888.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/217888.html

"STREQUAL" "x86_64" Unknown arguments specified
瑙e喅錛?br />
if($ENV(COMPILING_TYPE) STREQUAL "x86_64")
鏀逛負(fù)錛?/span>
if(($ENV(COMPILING_TYPE)) STREQUAL "x86_64")


O浜嗭紒



灝忕帇 2021-12-22 16:24 鍙戣〃璇勮
]]>
Centos涓崌綰cc錛堢紪璇慶make鎶ラ敊錛氣榤ake_unique鈥欎笉鏄榮td鈥欑殑鎴愬憳錛?/title><link>http://www.shnenglu.com/jack-wang/archive/2020/01/10/217078.html</link><dc:creator>灝忕帇</dc:creator><author>灝忕帇</author><pubDate>Fri, 10 Jan 2020 07:11:00 GMT</pubDate><guid>http://www.shnenglu.com/jack-wang/archive/2020/01/10/217078.html</guid><wfw:comment>http://www.shnenglu.com/jack-wang/comments/217078.html</wfw:comment><comments>http://www.shnenglu.com/jack-wang/archive/2020/01/10/217078.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jack-wang/comments/commentRss/217078.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jack-wang/services/trackbacks/217078.html</trackback:ping><description><![CDATA[make_unique鏄寘鍚湪C++14涓殑錛実cc鐗堟湰榪囦綆錛屽畨瑁呮柊鐗堟湰gcc錛屾瘮濡?.x <br /> 1銆佸畨瑁卌entos-release-scl <br />sudo yum install centos-release-scl <br /> 2銆佸畨瑁卍evtoolset <br />sudo yum install devtoolset-9-gcc* <br />錛堝鏋滄兂瀹夎7.*鐗堟湰鐨勶紝灝辨敼鎴恉evtoolset-7-gcc*錛? <br />3銆佹縺媧誨搴旂殑devtoolset錛屾墍浠ヤ綘鍙互涓嬈″畨瑁呭涓増鏈殑devtoolset錛?br />闇瑕佺殑鏃跺欑敤涓嬮潰浠ヤ笅鍛戒護(hù)鍒囨崲鍒板搴旂殑鐗堟湰 <br />scl enable devtoolset-9 bash <br /> 4銆佹煡鐪媑cc鐗堟湰 gcc -v 鏄劇ず涓?.x O浜嗭紒<img src ="http://www.shnenglu.com/jack-wang/aggbug/217078.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jack-wang/" target="_blank">灝忕帇</a> 2020-01-10 15:11 <a href="http://www.shnenglu.com/jack-wang/archive/2020/01/10/217078.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍑犱釜鍩烘湰鐨勫簱鍑芥暟錛屽蹇?/title><link>http://www.shnenglu.com/jack-wang/archive/2010/09/14/126543.html</link><dc:creator>灝忕帇</dc:creator><author>灝忕帇</author><pubDate>Mon, 13 Sep 2010 16:24:00 GMT</pubDate><guid>http://www.shnenglu.com/jack-wang/archive/2010/09/14/126543.html</guid><wfw:comment>http://www.shnenglu.com/jack-wang/comments/126543.html</wfw:comment><comments>http://www.shnenglu.com/jack-wang/archive/2010/09/14/126543.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jack-wang/comments/commentRss/126543.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jack-wang/services/trackbacks/126543.html</trackback:ping><description><![CDATA[double pow(double x double k);<br>榪斿洖x鐨刱嬈℃柟錛屽彲浠ュ彟k=1/n,鍒欏嚱鏁拌繑鍥炵殑鏄痻鐨刵嬈℃柟鏍? <img src ="http://www.shnenglu.com/jack-wang/aggbug/126543.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jack-wang/" target="_blank">灝忕帇</a> 2010-09-14 00:24 <a href="http://www.shnenglu.com/jack-wang/archive/2010/09/14/126543.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浠g爜鑷姩鐢熸垚-瀹忓甫鏉ョ殑濂囨妧娣閥 http://www.shnenglu.com/jack-wang/archive/2010/06/22/118512.html灝忕帇灝忕帇Tue, 22 Jun 2010 15:54:00 GMThttp://www.shnenglu.com/jack-wang/archive/2010/06/22/118512.htmlhttp://www.shnenglu.com/jack-wang/comments/118512.htmlhttp://www.shnenglu.com/jack-wang/archive/2010/06/22/118512.html#Feedback1http://www.shnenglu.com/jack-wang/comments/commentRss/118512.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/118512.html闃呰鍏ㄦ枃

灝忕帇 2010-06-22 23:54 鍙戣〃璇勮
]]>
VS2005/2008 warning C4251 needs to have dll-interfacehttp://www.shnenglu.com/jack-wang/archive/2010/04/07/111826.html灝忕帇灝忕帇Wed, 07 Apr 2010 00:57:00 GMThttp://www.shnenglu.com/jack-wang/archive/2010/04/07/111826.htmlhttp://www.shnenglu.com/jack-wang/comments/111826.htmlhttp://www.shnenglu.com/jack-wang/archive/2010/04/07/111826.html#Feedback1http://www.shnenglu.com/jack-wang/comments/commentRss/111826.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/111826.html   紼嬪簭涓秷闄arning鏈変袱縐嶆柟娉曪細(xì)娑堟瀬涓鐐逛笉鍘葷悊浠栵紝鍙嶆涓嶆槸error:-)錛涚Н鏋佷竴鐐癸紝鍒欐兂鍔炴硶鍘繪帀銆傚幓鎺夊張鐢ㄤ袱縐嶆柟娉曪細(xì)涓縐嶄嬌鐢?pragma warning(disable: xxxx)錛岀溂涓嶈錛屽績涓嶇儲錛涘彟澶栧氨鏄壘鍑鴻В鍐抽棶棰樼殑鍔炴硶浜嗐?br>  浠婂ぉ鍋歞ll搴撴椂錛屽湪struct涓敤鍒頒簡stl錛?br>  class CLASS_TEST
  {
    ...
  private:
    std::vector<MY_STRUCT> m_structs;
  }
  浣嗘槸緙栬瘧鏃訛紝vs2005緇欏嚭浜唚arning C4251: 'CLASS_TEST::m_structs' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class ‘CLASS_TEST’鐨勮鍛婁俊鎭傝垂浜嗗緢澶х殑鍔叉墠瑙e喅鎺夛紝璁板綍涓嬫潵銆?/p>

  鍦ㄥご鏂囦歡涓紝瀹氫箟瀹?br>#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif

  鐜板湪錛屽湪鍙橀噺m_structs鍓嶏紝娣誨姞錛?br>template class MYDLL_API std::allocator<myStruct>;
template class MYDLL_API std::vector<myStruct, std::allocator<myStruct> >;
  榪欐牱錛屽嵆鍙互浜嗐?/p>

 

 



灝忕帇 2010-04-07 08:57 鍙戣〃璇勮
]]>
瀛楄妭瀵歸綈璇﹁Вhttp://www.shnenglu.com/jack-wang/archive/2010/03/17/109901.html灝忕帇灝忕帇Wed, 17 Mar 2010 07:55:00 GMThttp://www.shnenglu.com/jack-wang/archive/2010/03/17/109901.htmlhttp://www.shnenglu.com/jack-wang/comments/109901.htmlhttp://www.shnenglu.com/jack-wang/archive/2010/03/17/109901.html#Feedback0http://www.shnenglu.com/jack-wang/comments/commentRss/109901.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/109901.htmlhttp://blog.csdn.net/jszj/archive/2009/02/20/3915328.aspx

涓.浠涔堟槸瀛楄妭瀵歸綈,涓轟粈涔堣瀵歸綈?
    鐜頒唬璁$畻鏈轟腑鍐呭瓨絀洪棿閮芥槸鎸夌収byte鍒掑垎鐨勶紝浠庣悊璁轟笂璁蹭技涔庡浠諱綍綾誨瀷鐨勫彉閲忕殑璁塊棶鍙互浠庝換浣曞湴鍧寮濮嬶紝浣嗗疄闄呮儏鍐墊槸鍦ㄨ闂壒瀹氱被鍨嬪彉閲忕殑鏃跺欑粡甯稿湪鐗?瀹氱殑鍐呭瓨鍦板潃璁塊棶錛岃繖灝遍渶瑕佸悇縐嶇被鍨嬫暟鎹寜鐓т竴瀹氱殑瑙勫垯鍦ㄧ┖闂翠笂鎺掑垪錛岃屼笉鏄『搴忕殑涓涓帴涓涓殑鎺掓斁錛岃繖灝辨槸瀵歸綈銆?br>    瀵歸綈鐨勪綔鐢ㄥ拰鍘熷洜錛氬悇涓‖浠跺鉤鍙板瀛樺偍絀洪棿鐨勫鐞嗕笂鏈夊緢澶х殑涓嶅悓銆備竴浜涘鉤鍙板鏌愪簺鐗瑰畾綾誨瀷鐨勬暟鎹彧鑳戒粠鏌愪簺鐗瑰畾鍦板潃寮濮嬪瓨鍙栥傛瘮濡傛湁浜涙灦鏋勭殑CPU鍦ㄨ闂?涓涓病鏈夎繘琛屽榻愮殑鍙橀噺鐨勬椂鍊欎細(xì)鍙戠敓閿欒,閭d箞鍦ㄨ繖縐嶆灦鏋勪笅緙栫▼蹇呴』淇濊瘉瀛楄妭瀵歸綈.鍏朵粬騫沖彴鍙兘娌℃湁榪欑鎯呭喌錛屼絾鏄渶甯歌鐨勬槸濡傛灉涓嶆寜鐓ч傚悎鍏跺鉤鍙拌姹傚 鏁版嵁瀛樻斁榪涜瀵歸綈錛屼細(xì)鍦ㄥ瓨鍙栨晥鐜囦笂甯︽潵鎹熷け銆傛瘮濡傛湁浜涘鉤鍙版瘡嬈¤閮芥槸浠庡伓鍦板潃寮濮嬶紝濡傛灉涓涓猧nt鍨嬶紙鍋囪涓?2浣嶇郴緇燂級濡傛灉瀛樻斁鍦ㄥ伓鍦板潃寮濮嬬殑鍦版柟錛岄偅 涔堜竴涓鍛ㄦ湡灝卞彲浠ヨ鍑鴻繖32bit錛岃屽鏋滃瓨鏀懼湪濂囧湴鍧寮濮嬬殑鍦版柟錛屽氨闇瑕?涓鍛ㄦ湡錛屽茍瀵逛袱嬈¤鍑虹殑緇撴灉鐨勯珮浣庡瓧鑺傝繘琛屾嫾鍑戞墠鑳藉緱鍒拌32bit鏁?鎹傛樉鐒跺湪璇誨彇鏁堢巼涓婁笅闄嶅緢澶氥?/p>

浜?瀛楄妭瀵歸綈瀵圭▼搴忕殑褰卞搷:
    鍏堣鎴戜滑鐪嬪嚑涓緥瀛愬惂(32bit,x86鐜,gcc緙栬瘧鍣?:
璁劇粨鏋勪綋濡備笅瀹氫箟錛?br>struct A
{
    int a;
    char b;
    short c;
};
struct B
{
    char b;
    int a;
    short c;
};
鐜板湪宸茬煡32浣嶆満鍣ㄤ笂鍚勭鏁版嵁綾誨瀷鐨勯暱搴﹀涓?
char:1(鏈夌鍙鋒棤絎﹀彿鍚?   
short:2(鏈夌鍙鋒棤絎﹀彿鍚?   
int:4(鏈夌鍙鋒棤絎﹀彿鍚?   
long:4(鏈夌鍙鋒棤絎﹀彿鍚?   
float:4    double:8
閭d箞涓婇潰涓や釜緇撴瀯澶у皬濡備綍鍛?
緇撴灉鏄?
sizeof(strcut A)鍊間負(fù)8
sizeof(struct B)鐨勫煎嵈鏄?2

緇撴瀯浣揂涓寘鍚簡4瀛楄妭闀垮害鐨刬nt涓涓紝1瀛楄妭闀垮害鐨刢har涓涓拰2瀛楄妭闀垮害鐨剆hort鍨嬫暟鎹竴涓?B涔熶竴鏍?鎸夌悊璇碅,B澶у皬搴旇閮芥槸7瀛楄妭銆?br>涔嬫墍浠ュ嚭鐜頒笂闈㈢殑緇撴灉鏄洜涓虹紪璇戝櫒瑕佸鏁版嵁鎴愬憳鍦ㄧ┖闂翠笂榪涜瀵歸綈銆備笂闈㈡槸鎸夌収緙栬瘧鍣ㄧ殑榛樿璁劇疆榪涜瀵歸綈鐨勭粨鏋?閭d箞鎴戜滑鏄笉鏄彲浠ユ敼鍙樼紪璇戝櫒鐨勮繖縐嶉粯璁ゅ榻愯緗憿,褰撶劧鍙互.渚嬪:
#pragma pack (2) /*鎸囧畾鎸?瀛楄妭瀵歸綈*/
struct C
{
    char b;
    int a;
    short c;
};
#pragma pack () /*鍙栨秷鎸囧畾瀵歸綈錛屾仮澶嶇己鐪佸榻?/
sizeof(struct C)鍊兼槸8銆?br>淇敼瀵歸綈鍊間負(fù)1錛?br>#pragma pack (1) /*鎸囧畾鎸?瀛楄妭瀵歸綈*/
struct D
{
    char b;
    int a;
    short c;
};
#pragma pack () /*鍙栨秷鎸囧畾瀵歸綈錛屾仮澶嶇己鐪佸榻?/
sizeof(struct D)鍊間負(fù)7銆?br>鍚庨潰鎴戜滑鍐嶈瑙?pragma pack()鐨勪綔鐢?

涓?緙栬瘧鍣ㄦ槸鎸夌収浠涔堟牱鐨勫師鍒欒繘琛屽榻愮殑?
    鍏堣鎴戜滑鐪嬪洓涓噸瑕佺殑鍩烘湰姒傚康錛?br>1.鏁版嵁綾誨瀷鑷韓鐨勫榻愬鹼細(xì)
  瀵逛簬char鍨嬫暟鎹紝鍏惰嚜韜榻愬間負(fù)1錛屽浜巗hort鍨嬩負(fù)2錛屽浜巌nt,float,double綾誨瀷錛屽叾鑷韓瀵歸綈鍊間負(fù)4錛屽崟浣嶅瓧鑺傘?br>2.緇撴瀯浣撴垨鑰呯被鐨勮嚜韜榻愬鹼細(xì)鍏舵垚鍛樹腑鑷韓瀵歸綈鍊兼渶澶х殑閭d釜鍊箋?br>3.鎸囧畾瀵歸綈鍊鹼細(xì)#pragma pack (value)鏃剁殑鎸囧畾瀵歸綈鍊紇alue銆?br>4.鏁版嵁鎴愬憳銆佺粨鏋勪綋鍜岀被鐨勬湁鏁堝榻愬鹼細(xì)鑷韓瀵歸綈鍊煎拰鎸囧畾瀵歸綈鍊間腑灝忕殑閭d釜鍊箋?br>鏈?浜嗚繖浜涘鹼紝鎴戜滑灝卞彲浠ュ緢鏂逛究鐨勬潵璁ㄨ鍏蜂綋鏁版嵁緇撴瀯鐨勬垚鍛樺拰鍏惰嚜韜殑瀵歸綈鏂瑰紡銆傛湁鏁堝榻愬糔鏄渶緇堢敤鏉ュ喅瀹氭暟鎹瓨鏀懼湴鍧鏂瑰紡鐨勫鹼紝鏈閲嶈銆傛湁鏁堝榻怤錛屽氨鏄?琛ㄧず“瀵歸綈鍦∟涓?#8221;錛屼篃灝辨槸璇磋鏁版嵁鐨?瀛樻斁璧峰鍦板潃%N=0".鑰屾暟鎹粨鏋勪腑鐨勬暟鎹彉閲忛兘鏄寜瀹氫箟鐨勫厛鍚庨『搴忔潵鎺掓斁鐨勩傜涓涓暟鎹彉閲忕殑璧峰鍦板潃灝辨槸鏁?鎹粨鏋勭殑璧峰鍦板潃銆傜粨鏋勪綋鐨勬垚鍛樺彉閲忚瀵歸綈鎺掓斁錛岀粨鏋勪綋鏈韓涔熻鏍規(guī)嵁鑷韓鐨勬湁鏁堝榻愬煎渾鏁?灝辨槸緇撴瀯浣撴垚鍛樺彉閲忓崰鐢ㄦ婚暱搴﹂渶瑕佹槸瀵圭粨鏋勪綋鏈夋晥瀵歸綈鍊肩殑鏁存暟 鍊嶏紝緇撳悎涓嬮潰渚嬪瓙鐞嗚В)銆傝繖鏍峰氨涓嶈兘鐞嗚В涓婇潰鐨勫嚑涓緥瀛愮殑鍊間簡銆?br>渚嬪瓙鍒嗘瀽錛?br>鍒嗘瀽渚嬪瓙B錛?br>struct B
{
    char b;
    int a;
    short c;
};
鍋?璁綛浠庡湴鍧絀洪棿0x0000寮濮嬫帓鏀俱傝渚嬪瓙涓病鏈夊畾涔夋寚瀹氬榻愬鹼紝鍦ㄧ瑪鑰呯幆澧冧笅錛岃鍊奸粯璁や負(fù)4銆傜涓涓垚鍛樺彉閲廱鐨勮嚜韜榻愬兼槸1錛屾瘮鎸囧畾鎴栬呴粯璁ゆ寚瀹?瀵歸綈鍊?灝忥紝鎵浠ュ叾鏈夋晥瀵歸綈鍊間負(fù)1錛屾墍浠ュ叾瀛樻斁鍦板潃0x0000絎﹀悎0x0000%1=0.絎簩涓垚鍛樺彉閲廰錛屽叾鑷韓瀵歸綈鍊間負(fù)4錛屾墍浠ユ湁鏁堝榻愬間篃涓?錛?鎵浠ュ彧鑳藉瓨鏀懼湪璧峰鍦板潃涓?x0004鍒?x0007榪欏洓涓繛緇殑瀛楄妭絀洪棿涓紝澶嶆牳0x0004%4=0,涓旂揣闈犵涓涓彉閲忋傜涓変釜鍙橀噺c,鑷韓瀵歸綈鍊間負(fù) 2錛屾墍浠ユ湁鏁堝榻愬間篃鏄?錛屽彲浠ュ瓨鏀懼湪0x0008鍒?x0009榪欎袱涓瓧鑺傜┖闂翠腑錛岀鍚?x0008%2=0銆傛墍浠ヤ粠0x0000鍒?x0009瀛樻斁鐨?閮芥槸B鍐呭銆傚啀鐪嬫暟鎹粨鏋凚鐨勮嚜韜榻愬間負(fù)鍏跺彉閲忎腑鏈澶у榻愬?榪欓噷鏄痓錛夋墍浠ュ氨鏄?錛屾墍浠ョ粨鏋勪綋鐨勬湁鏁堝榻愬間篃鏄?銆傛牴鎹粨鏋勪綋鍦嗘暣鐨勮姹傦紝 0x0009鍒?x0000=10瀛楄妭錛岋紙10錛?錛夛紖4錛?銆傛墍浠?x0000A鍒?x000B涔熶負(fù)緇撴瀯浣揃鎵鍗犵敤銆傛晠B浠?x0000鍒?x000B 鍏辨湁12涓瓧鑺?sizeof(struct B)=12;鍏跺疄濡傛灉灝辮繖涓涓氨鏉ヨ瀹冨凡灝嗘弧瓚沖瓧鑺傚榻愪簡, 鍥犱負(fù)瀹冪殑璧峰鍦板潃鏄?,鍥犳鑲畾鏄榻愮殑,涔嬫墍浠ュ湪鍚庨潰琛ュ厖2涓瓧鑺?鏄洜涓虹紪璇戝櫒涓轟簡瀹炵幇緇撴瀯鏁扮粍鐨勫瓨鍙栨晥鐜?璇曟兂濡傛灉鎴戜滑瀹氫箟浜嗕竴涓粨鏋凚鐨勬暟緇?閭?涔堢涓涓粨鏋勮搗濮嬪湴鍧鏄?娌℃湁闂,浣嗘槸絎簩涓粨鏋勫憿?鎸夌収鏁扮粍鐨勫畾涔?鏁扮粍涓墍鏈夊厓绱犻兘鏄揣鎸ㄧ潃鐨?濡傛灉鎴戜滑涓嶆妸緇撴瀯鐨勫ぇ灝忚ˉ鍏呬負(fù)4鐨勬暣鏁板?閭d箞涓嬩竴 涓粨鏋勭殑璧峰鍦板潃灝嗘槸0x0000A,榪欐樉鐒朵笉鑳芥弧瓚崇粨鏋勭殑鍦板潃瀵歸綈浜?鍥犳鎴戜滑瑕佹妸緇撴瀯琛ュ厖鎴愭湁鏁堝榻愬ぇ灝忕殑鏁存暟鍊?鍏跺疄璇稿:瀵逛簬char鍨嬫暟鎹紝鍏?鑷韓瀵歸綈鍊間負(fù)1錛屽浜巗hort鍨嬩負(fù)2錛屽浜巌nt,float,double綾誨瀷錛屽叾鑷韓瀵歸綈鍊間負(fù)4錛岃繖浜涘凡鏈夌被鍨嬬殑鑷韓瀵歸綈鍊間篃鏄熀浜庢暟緇勮冭檻鐨?鍙?鏄洜涓鴻繖浜涚被鍨嬬殑闀垮害宸茬煡浜?鎵浠ヤ粬浠殑鑷韓瀵歸綈鍊間篃灝卞凡鐭ヤ簡.
鍚岀悊,鍒嗘瀽涓婇潰渚嬪瓙C錛?br>#pragma pack (2) /*鎸囧畾鎸?瀛楄妭瀵歸綈*/
struct C
{
    char b;
    int a;
    short c;
};
#pragma pack () /*鍙栨秷鎸囧畾瀵歸綈錛屾仮澶嶇己鐪佸榻?/
絎?涓涓彉閲廱鐨勮嚜韜榻愬間負(fù)1錛屾寚瀹氬榻愬間負(fù)2錛屾墍浠ワ紝鍏舵湁鏁堝榻愬間負(fù)1錛屽亣璁綜浠?x0000寮濮嬶紝閭d箞b瀛樻斁鍦?x0000錛岀鍚?x0000%1= 0;絎簩涓彉閲忥紝鑷韓瀵歸綈鍊間負(fù)4錛屾寚瀹氬榻愬間負(fù)2錛屾墍浠ユ湁鏁堝榻愬間負(fù)2錛屾墍浠ラ『搴忓瓨鏀懼湪0x0002銆?x0003銆?x0004銆?x0005鍥涗釜榪炵畫 瀛楄妭涓紝絎﹀悎0x0002%2=0銆傜涓変釜鍙橀噺c鐨勮嚜韜榻愬間負(fù)2錛屾墍浠ユ湁鏁堝榻愬間負(fù)2錛岄『搴忓瓨鏀?br>鍦?x0006銆?x0007涓紝絎﹀悎 0x0006%2=0銆傛墍浠ヤ粠0x0000鍒?x00007鍏卞叓瀛楄妭瀛樻斁鐨勬槸C鐨勫彉閲忋傚張C鐨勮嚜韜榻愬間負(fù)4錛屾墍浠鐨勬湁鏁堝榻愬間負(fù)2銆傚張8%2=0,C 鍙崰鐢?x0000鍒?x0007鐨勫叓涓瓧鑺傘傛墍浠izeof(struct C)=8.

鍥?濡備綍淇敼緙栬瘧鍣ㄧ殑榛樿瀵歸綈鍊?
1.鍦╒C IDE涓紝鍙互榪欐牱淇敼錛歔Project]|[Settings],c/c++閫夐」鍗ategory鐨凜ode Generation閫夐」鐨凷truct Member Alignment涓慨鏀癸紝榛樿鏄?瀛楄妭銆?br>2.鍦ㄧ紪鐮佹椂錛屽彲浠ヨ繖鏍峰姩鎬佷慨鏀癸細(xì)#pragma pack .娉ㄦ剰:鏄痯ragma鑰屼笉鏄痯rogma.

浜?閽堝瀛楄妭瀵歸綈,鎴戜滑鍦ㄧ紪紼嬩腑濡備綍鑰冭檻?

    濡傛灉鍦ㄧ紪紼嬬殑鏃跺欒鑰冭檻鑺傜害絀洪棿鐨勮瘽,閭d箞鎴戜滑鍙渶瑕佸亣瀹氱粨鏋勭殑棣栧湴鍧鏄?,鐒跺悗鍚勪釜鍙橀噺鎸夌収涓婇潰鐨勫師鍒欒繘琛屾帓鍒楀嵆鍙?鍩烘湰鐨勫師鍒欏氨鏄妸緇撴瀯涓殑鍙橀噺鎸夌収 綾誨瀷澶у皬浠庡皬鍒板ぇ澹版槑,灝介噺鍑忓皯涓棿鐨勫~琛ョ┖闂?榪樻湁涓縐嶅氨鏄負(fù)浜嗕互絀洪棿鎹㈠彇鏃墮棿鐨勬晥鐜?鎴戜滑鏄劇ず鐨勮繘琛屽~琛ョ┖闂磋繘琛屽榻?姣斿:鏈変竴縐嶄嬌鐢ㄧ┖闂存崲鏃墮棿鍋?娉曟槸鏄懼紡鐨勬彃鍏eserved鎴愬憳錛?br>         struct A{
           char a;
           char reserved[3];//浣跨敤絀洪棿鎹㈡椂闂?br>           int b;
}

reserved鎴愬憳瀵規(guī)垜浠殑紼嬪簭娌℃湁浠涔堟剰涔?瀹冨彧鏄搗鍒板~琛ョ┖闂翠互杈懼埌瀛楄妭瀵歸綈鐨勭洰鐨?褰撶劧鍗充嬌涓嶅姞榪欎釜鎴愬憳閫氬父緙栬瘧鍣ㄤ篃浼?xì)缁欐垜浠嚜鍔ㄥ~琛ュ瘹w綈,鎴戜滑鑷繁鍔犱笂瀹冨彧鏄搗鍒版樉寮忕殑鎻愰啋浣滅敤.

鍏?瀛楄妭瀵歸綈鍙兘甯︽潵鐨勯殣鎮(zhèn)?
    浠g爜涓叧浜庡榻愮殑闅愭?zhèn)eQ屽緢澶氭槸闅愬紡鐨勩傛瘮濡傚湪寮哄埗綾誨瀷杞崲鐨勬椂鍊欍備緥濡傦細(xì)
unsigned int i = 0x12345678;
unsigned char *p=NULL;
unsigned short *p1=NULL;

p=&i;
*p=0x00;
p1=(unsigned short *)(p+1);
*p1=0x0000;
鏈鍚庝袱鍙ヤ唬鐮侊紝浠庡鏁拌竟鐣屽幓璁塊棶unsignedshort鍨嬪彉閲忥紝鏄劇劧涓嶇鍚堝榻愮殑瑙勫畾銆?br>鍦▁86涓婏紝綾諱技鐨勬搷浣滃彧浼?xì)濯勫搷鏁堢巼锛屼絾鏄湪MIPS鎴栬卻parc涓婏紝鍙兘灝辨槸涓涓猠rror,鍥犱負(fù)瀹冧滑瑕佹眰蹇呴』瀛楄妭瀵歸綈.

涓?濡備綍鏌ユ壘涓庡瓧鑺傚榻愭柟闈㈢殑闂:
濡傛灉鍑虹幇瀵歸綈鎴栬呰祴鍊奸棶棰橀鍏堟煡鐪?br>1. 緙栬瘧鍣ㄧ殑big little绔緗?br>2. 鐪嬭繖縐嶄綋緋繪湰韜槸鍚︽敮鎸侀潪瀵歸綈璁塊棶
3. 濡傛灉鏀寔鐪嬭緗簡瀵歸綈涓庡惁,濡傛灉娌℃湁鍒欑湅璁塊棶鏃墮渶瑕佸姞鏌愪簺鐗規(guī)畩鐨勪慨楗版潵鏍囧織鍏剁壒孌婅闂搷浣溿?/p>

鍏?鐩稿叧鏂囩珷:杞嚜http://blog.csdn.net/goodluckyxl/archive/2005/10/17/506827.aspx

 ARM涓嬬殑瀵歸綈澶勭悊
from DUI0067D_ADS1_2_CompLib

3.13 type  qulifiers

鏈夐儴鍒嗘憳鑷狝RM緙栬瘧鍣ㄦ枃妗e榻愰儴鍒?/p>

瀵歸綈鐨勪嬌鐢?
1.__align(num)
   榪欎釜鐢ㄤ簬淇敼鏈楂樼駭鍒璞$殑瀛楄妭杈圭晫銆傚湪姹囩紪涓嬌鐢↙DRD鎴栬匰TRD鏃?br>   灝辮鐢ㄥ埌姝ゅ懡浠_align(8)榪涜淇グ闄愬埗銆傛潵淇濊瘉鏁版嵁瀵硅薄鏄浉搴斿榻愩?br>   榪欎釜淇グ瀵硅薄鐨勫懡浠ゆ渶澶ф槸8涓瓧鑺傞檺鍒?鍙互璁?瀛楄妭鐨勫璞¤繘琛?瀛楄妭
   瀵歸綈,浣嗘槸涓嶈兘璁?瀛楄妭鐨勫璞?瀛楄妭瀵歸綈銆?br>   __align鏄瓨鍌ㄧ被淇敼,浠栧彧淇グ鏈楂樼駭綾誨瀷瀵硅薄涓嶈兘鐢ㄤ簬緇撴瀯鎴栬呭嚱鏁板璞°?br>  
2.__packed
  __packed鏄繘琛屼竴瀛楄妭瀵歸綈
  1.涓嶈兘瀵筽acked鐨勫璞¤繘琛屽榻?br>  2.鎵鏈夊璞$殑璇誨啓璁塊棶閮借繘琛岄潪瀵歸綈璁塊棶
  3.float鍙?qiáng)鍖呭惈float鐨勭粨鏋勮仈鍚堝強(qiáng)鏈敤__packed鐨勫璞″皢涓嶈兘瀛楄妭瀵歸綈
  4.__packed瀵瑰眬閮ㄦ暣褰㈠彉閲忔棤褰卞搷
  5.寮哄埗鐢眜npacked瀵硅薄鍚憄acked瀵硅薄杞寲鏄湭瀹氫箟,鏁村艦鎸囬拡鍙互鍚堟硶瀹?br>  涔変負(fù)packed銆?br>     __packed int* p;  //__packed int 鍒欐病鏈夋剰涔?br>  6.瀵歸綈鎴栭潪瀵歸綈璇誨啓璁塊棶甯︽潵闂
  __packed struct STRUCT_TEST
 {
  char a;
  int b;
  char c;
 }  ;    //瀹氫箟濡備笅緇撴瀯姝ゆ椂b鐨勮搗濮嬪湴鍧涓瀹氭槸涓嶅榻愮殑
         //鍦ㄦ爤涓闂産鍙兘鏈夐棶棰?鍥犱負(fù)鏍堜笂鏁版嵁鑲畾鏄榻愯闂甗from CL]
//灝嗕笅闈㈠彉閲忓畾涔夋垚鍏ㄥ眬闈欐佷笉鍦ㄦ爤涓?
static char* p;
static struct STRUCT_TEST a;
void Main()
{
 __packed int* q;  //姝ゆ椂瀹氫箟鎴恄_packed鏉ヤ慨楗板綋鍓峲鎸囧悜涓洪潪瀵歸綈鐨勬暟鎹湴鍧涓嬮潰鐨勮闂垯鍙互

 p = (char*)&a;         
 q = (int*)(p+1);     
 
 *q = 0x87654321;
/*  
寰楀埌璧嬪肩殑姹囩紪鎸囦護(hù)寰堟竻妤?br>ldr      r5,0x20001590 ; = #0x12345678
[0xe1a00005]   mov      r0,r5
[0xeb0000b0]   bl       __rt_uwrite4  //鍦ㄦ澶勮皟鐢ㄤ竴涓啓4byte鐨勬搷浣滃嚱鏁?
     
[0xe5c10000]   strb     r0,[r1,#0]   //鍑芥暟榪涜4嬈trb鎿嶄綔鐒跺悗榪斿洖淇濊瘉浜嗘暟鎹紜殑璁塊棶
[0xe1a02420]   mov      r2,r0,lsr #8
[0xe5c12001]   strb     r2,[r1,#1]
[0xe1a02820]   mov      r2,r0,lsr #16
[0xe5c12002]   strb     r2,[r1,#2]
[0xe1a02c20]   mov      r2,r0,lsr #24
[0xe5c12003]   strb     r2,[r1,#3]
[0xe1a0f00e]   mov      pc,r14
*/

/*
濡傛灉q娌℃湁鍔燺_packed淇グ鍒欐眹緙栧嚭鏉ユ寚浠ゆ槸榪欐牱鐩存帴浼?xì)瀵艰嚧濂囧湴鍧澶勮闂け璐?br>[0xe59f2018]   ldr      r2,0x20001594 ; = #0x87654321
[0xe5812000]   str      r2,[r1,#0]
*/

//榪欐牱鍙互寰堟竻妤氱殑鐪嬪埌闈炲榻愯闂槸濡備綍浜х敓閿欒鐨?br>//浠ュ強(qiáng)濡備綍娑堥櫎闈炲榻愯闂甫鏉ラ棶棰?br>//涔熷彲浠ョ湅鍒伴潪瀵歸綈璁塊棶鍜屽榻愯闂殑鎸囦護(hù)宸紓瀵艱嚧鏁堢巼闂
}
 


鏈枃鏉ヨ嚜CSDN鍗氬錛岃漿杞借鏍囨槑鍑哄錛?a >http://blog.csdn.net/jszj/archive/2009/02/20/3915328.aspx



灝忕帇 2010-03-17 15:55 鍙戣〃璇勮
]]>
Visual C++2010鐨刢++璇█鍥涘ぇ鏂扮壒鎬?/title><link>http://www.shnenglu.com/jack-wang/archive/2010/03/15/109750.html</link><dc:creator>灝忕帇</dc:creator><author>灝忕帇</author><pubDate>Mon, 15 Mar 2010 10:25:00 GMT</pubDate><guid>http://www.shnenglu.com/jack-wang/archive/2010/03/15/109750.html</guid><wfw:comment>http://www.shnenglu.com/jack-wang/comments/109750.html</wfw:comment><comments>http://www.shnenglu.com/jack-wang/archive/2010/03/15/109750.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jack-wang/comments/commentRss/109750.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jack-wang/services/trackbacks/109750.html</trackback:ping><description><![CDATA[<p style="FONT-SIZE: 10pt">杞細(xì)<a >http://blog.csdn.net/yincheng01/archive/2010/03/11/5367032.aspx</a><br><br>寰蔣鍗沖皢鍦?010騫?鏈?2鏃ュ彂甯僔S2010鐨勬寮忕増錛屽浜巆++璇█鍋氫簡淇敼錛屼嬌涔嬫洿鍔犵鍚坈++鏍囧噯銆?/p> <p style="FONT-SIZE: 10pt">涓嬮潰瀵逛簬寰蔣瀵逛簬c++璇█鐨勪慨鏀瑰仛涓涓嬪垎鏋愶紒</p> <p style="FONT-SIZE: 10pt">Lambda琛ㄨ揪寮?/p> <p style="FONT-SIZE: 10pt">  寰堝緙栫▼緙栫▼璇█閮芥敮鎸佸尶鍚嶅嚱鏁?anonymous function)銆傛墍璋撳尶鍚嶅嚱鏁幫紝灝辨槸榪欎釜鍑芥暟鍙湁鍑芥暟浣擄紝鑰屾病鏈夊嚱鏁板悕銆侺ambda琛ㄨ揪寮忓氨鏄疄鐜板尶鍚嶅嚱鏁扮殑涓縐嶇紪紼嬫妧宸э紝瀹冧負(fù)緙栧啓鍖垮悕鍑芥暟鎻愪緵浜嗙畝鏄庣殑鍑芥暟寮忕殑鍙ユ硶銆傚悓鏍鋒槸Visual Studio涓殑寮鍙戣璦錛孷isual Basic鍜孷isual C#鏃╁氨瀹炵幇浜嗗Lambda琛ㄨ揪寮忕殑鏀寔錛岀粓浜嶸isual C++榪欐涔熶笉鐢樿惤鍚庯紝鍦╒isual Studio 2010涓坊鍔犱簡瀵筁ambda琛ㄨ揪寮忕殑鏀寔銆?br>  Lambda琛ㄨ揪寮忎嬌寰楀嚱鏁板彲浠ュ湪浣跨敤鐨勫湴鏂瑰畾涔夛紝騫朵笖鍙互鍦↙ambda鍑芥暟涓嬌鐢↙ambda鍑芥暟涔嬪鐨勬暟鎹傝繖灝變負(fù)閽堝闆嗗悎鎿嶄綔甯︽潵浜嗗緢澶х殑渚垮埄銆傚湪浣滅敤涓婏紝Lambda琛ㄨ揪寮忕被浼間簬鍑芥暟鎸囬拡鍜屽嚱鏁板璞★紝Lambda琛ㄨ揪寮忓緢濂藉湴鍏奸【浜嗗嚱鏁版寚閽堝拰鍑芥暟瀵硅薄鐨勪紭鐐癸紝鍗存病鏈夊畠浠殑緙虹偣銆傜浉瀵逛簬鍑芥暟鎸囬拡鎴栨槸鍑芥暟瀵硅薄澶嶆潅鐨勮娉曞艦寮忥紝Lambda琛ㄨ揪寮忎嬌鐢ㄩ潪甯哥畝鍗曠殑璇硶灝卞彲浠ュ疄鐜板悓鏍風(fēng)殑鍔熻兘錛岄檷浣庝簡Lambda琛ㄨ揪寮忕殑瀛︿範(fàn)闅懼害錛岄伩鍏嶄簡浣跨敤澶嶆潅鐨勫嚱鏁板璞℃垨鏄嚱鏁版寚閽堟墍甯︽潵鐨勯敊璇傛垜浠彲浠ョ湅涓涓疄闄呯殑渚嬪瓙錛?/p> <p style="FONT-SIZE: 10pt">view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>#include "stdafx.h"   <br>#include <algorithm>   <br>#include <iostream>   <br>#include <ostream>   <br>#include <vector>   <br>  <br>using namespace std;   <br>  <br>int _tmain(int argc, _TCHAR* argv[])   <br>{   <br>    vector<int> v;   <br>    for (int i = 0; i < 10; ++i) {   <br>        v.push_back(i);   <br>    }   <br>         for_each(v.begin(), v.end(), [] (int n) {   <br>        cout << n;   <br>        if (n % 2 == 0) {   <br>            cout << " even ";   <br>        } else {   <br>            cout << " odd ";   <br>        }   <br>    });   <br>    cout << endl;   <br>  <br>    return 0;   <br>}  <br>#include "stdafx.h"<br>#include <algorithm><br>#include <iostream><br>#include <ostream><br>#include <vector></p> <p style="FONT-SIZE: 10pt">using namespace std;</p> <p style="FONT-SIZE: 10pt">int _tmain(int argc, _TCHAR* argv[])<br>{<br>    vector<int> v;<br>    for (int i = 0; i < 10; ++i) {<br>        v.push_back(i);<br>    }<br>         for_each(v.begin(), v.end(), [] (int n) {<br>        cout << n;<br>        if (n % 2 == 0) {<br>            cout << " even ";<br>        } else {<br>            cout << " odd ";<br>        }<br>    });<br>    cout << endl;</p> <p style="FONT-SIZE: 10pt">    return 0;<br>}<br> </p> <p style="FONT-SIZE: 10pt">  榪欐浠g爜寰幆閬嶅巻杈撳嚭vector涓殑姣忎竴涓暟錛屽茍鍒ゆ柇榪欎釜鏁版槸濂囨暟榪樻槸鍋舵暟銆傛垜浠彲浠ラ殢鏃朵慨鏀筁ambda琛ㄨ揪寮忚屾敼鍙樿繖涓尶鍚嶅嚱鏁扮殑瀹炵幇錛屼慨鏀瑰闆嗗悎鐨勬搷浣溿傚湪榪欐浠g爜涓紝C++浣跨敤涓瀵逛腑鎷彿“[]”鏉ヨ〃紺篖ambda琛ㄨ揪寮忕殑寮濮嬶紝鍏跺悗鐨?#8221;(int n)”琛ㄧずLambda琛ㄨ揪寮忕殑鍙傛暟銆傝繖浜涘弬鏁板皢鍦↙ambda琛ㄨ揪寮忎腑浣跨敤鍒般備負(fù)浜嗕綋浼?xì)Lambda琛ㄨ揪寮忕殑綆媧侊紝鎴戜滑鏉ョ湅鐪嬪悓鏍風(fēng)殑鍔熻兘錛屽浣曚嬌鐢ㄥ嚱鏁板璞″疄鐜幫細(xì)<br> <br>view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>#include "stdafx.h"   <br>#include <algorithm>   <br>#include <iostream>   <br>#include <ostream>   <br>#include <vector>   <br>using namespace std;   <br>  <br>struct LambdaFunctor {   <br>    void operator()(int n) const {   <br>        cout << n << " ";   <br>        if (n % 2 == 0) {   <br>            cout << " even ";   <br>        } else {   <br>            cout << " odd ";   <br>        }   <br>  <br>    }   <br>};   <br>  <br>int _tmain(int argc, _TCHAR* argv[])   <br>{   <br>    vector<int> v;   <br>  <br>    for (int i = 0; i < 10; ++i) {   <br>        v.push_back(i);   <br>    }   <br>  <br>    for_each(v.begin(), v.end(), LambdaFunctor());   <br>    cout << endl;   <br>  <br>    return 0;   <br>}  <br>#include "stdafx.h"<br>#include <algorithm><br>#include <iostream><br>#include <ostream><br>#include <vector><br>using namespace std;</p> <p style="FONT-SIZE: 10pt">struct LambdaFunctor {<br>    void operator()(int n) const {<br>        cout << n << " ";<br>        if (n % 2 == 0) {<br>            cout << " even ";<br>        } else {<br>            cout << " odd ";<br>        }</p> <p style="FONT-SIZE: 10pt">    }<br>};</p> <p style="FONT-SIZE: 10pt">int _tmain(int argc, _TCHAR* argv[])<br>{<br>    vector<int> v;</p> <p style="FONT-SIZE: 10pt">    for (int i = 0; i < 10; ++i) {<br>        v.push_back(i);<br>    }</p> <p style="FONT-SIZE: 10pt">    for_each(v.begin(), v.end(), LambdaFunctor());<br>    cout << endl;</p> <p style="FONT-SIZE: 10pt">    return 0;<br>}<br> <br>  閫氳繃姣旇緝鎴戜滑灝卞彲浠ュ彂鐜幫紝Lambda琛ㄨ揪寮忕殑璇硶鏇村姞綆媧侊紝浣跨敤璧鋒潵鏇村姞綆鍗曢珮鏁?/p> <p style="FONT-SIZE: 10pt">闈欐佹柇璦static_assert</p> <p style="FONT-SIZE: 10pt">  鍦ㄤ箣鍓嶇殑C++鏍囧噯C++03涓紝鎴戜滑鍙互浣跨敤涓ょ鏂█錛?br>  • 浣跨敤棰勫鐞嗕腑鐨勬潯浠剁紪璇戝拰#error鎸囦護(hù)錛屽彲浠ュ湪棰勫鐞嗛樁孌墊鏌ヤ竴浜涚紪璇戞潯浠?br>  • 鍙互浣跨敤瀹廰ssert鏉ヨ繘琛岃繍琛屾椂媯鏌ワ紝浠ョ‘淇濈▼搴忛昏緫鐨勬紜?/p> <p style="FONT-SIZE: 10pt">  浣嗕嬌鐢?error鏂規(guī)硶鏄潪甯哥儲鐞愮殑錛屽茍涓斾笉鑳藉瀵規(guī)ā鏉垮弬鏁拌繘琛屾鏌ワ紝鍥犱負(fù)妯℃澘瀹炰緥鍖栨槸鍦ㄧ紪璇戞椂榪涜錛岃?error鏂規(guī)硶鏄湪棰勫鐞嗛樁孌佃繘琛岀殑銆傝宎ssert瀹忔槸鍦ㄨ繍琛屾椂榪涜媯鏌ャ備笉闅懼彂鐜幫紝鎴戜滑緙哄皯浜嗕竴鏍蜂笢瑗匡紝閭e氨鏄彲鐢ㄤ簬鍦ㄧ紪璇戞椂媯鏌ョ殑宸ュ叿銆備簬鏄紝闈欐佹柇璦搴旇繍鑰岀敓銆?/p> <p style="FONT-SIZE: 10pt">  鍦ㄦ柊鐨凜++鏍囧噯C++0x涓紝鍔犲叆浜嗗闈欐佹柇璦鐨勬敮鎸侊紝寮曞叆浜嗘柊鐨勫叧閿瓧static_assert鏉ヨ〃紺洪潤鎬佹柇璦銆備嬌鐢ㄩ潤鎬佹柇璦錛屾垜浠彲浠ュ湪紼嬪簭鐨勭紪璇戞椂鏈熸嫻嬩竴浜涙潯浠舵槸鍚︽垚绔嬶紝榪欎釜鐗規(guī)у湪璋冭瘯妯℃澘鍑芥暟鐨勬ā鏉垮弬鏁版椂鐗瑰埆鏈夌敤銆傚湪緙栬瘧鐨勬椂鍊欙紝妯℃澘鍑芥暟瀹炰緥鍖栵紝榪欐椂鎴戜滑灝卞彲浠ヤ嬌鐢ㄩ潤鎬佹柇璦鍘繪祴璇曟ā鏉垮嚱鏁扮殑鍙傛暟鏄惁鎸夌収鎴戜滑鐨勮璁℃嫢鏈夊悎閫傜殑鍊箋備緥濡備笅闈㈣繖孌典唬鐮侊細(xì)</p> <p style="FONT-SIZE: 10pt">view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>template <int N> struct Kitten {   <br>    static_assert(N < 2, "Kitten<N> requires N < 2.");   <br>};   <br>  <br>int main() {   <br>    Kitten<1> peppermint;   <br>    Kitten<3> jazz;   <br>  <br>   return 0;   <br>}  <br>template <int N> struct Kitten {<br>    static_assert(N < 2, "Kitten<N> requires N < 2.");<br>};</p> <p style="FONT-SIZE: 10pt">int main() {<br>    Kitten<1> peppermint;<br>    Kitten<3> jazz;</p> <p style="FONT-SIZE: 10pt">   return 0;<br>}<br> <br>  褰撴垜浠湪涓誨嚱鏁頒腑浣跨敤“1”鍘誨疄渚嬪寲Kitten榪欎釜緇撴瀯浣撴椂錛屽湪緙栬瘧鐨勬椂鍊欙紝闈欐佹柇璦static_assert浼?xì)娴嬭瘯鍙傛暟N鐨勫鹼紝褰揘鐨勫煎皬浜?鏃跺氨浼?xì)漶旂敓涓涓柇璦閿欒錛屽茍灝嗙浉搴旂殑璋冭瘯甯姪淇℃伅杈撳嚭鍒?#8220;Error List”紿楀彛涓紝榪欐牱紼嬪簭鍛樺氨鍙互瀵歸棶棰樺揩閫熷畾浣嶏紝瑙e喅闂灝辨洿鍔犳柟渚夸簡銆?br> </p> <p style="FONT-SIZE: 10pt"><br>鍥? static_assert鏂█鍙?qiáng)鍏惰緭鍑?/p> <p style="FONT-SIZE: 10pt"><br>  鍙﹀錛岄潤鎬佹柇璦榪樺甫鏉ュ緢澶氬叾浠栫殑浼樺娍銆備緥濡傞潤鎬佹柇璦鍦ㄧ紪璇戞椂榪涜澶勭悊錛屼笉浼?xì)漶旂敓鋼Q浣曡繍琛屾椂鍒葷┖闂村拰鏃墮棿涓婄殑寮閿錛岃繖灝變嬌寰楀畠姣攁ssert瀹忓叿鏈夋洿濂界殑鏁堢巼銆傚彟澶栨瘮杈冮噸瑕佺殑涓涓壒鎬ф槸濡傛灉鏂█澶辮觸錛屽畠浼?xì)漶旂敓鏈夋剰涔変笖鍏呭垎鐨勮瘖鏂俊鎭Q屽府鍔╃▼搴忓憳蹇熻В鍐抽棶棰樸?/p> <p style="FONT-SIZE: 10pt">  auto鍏抽敭瀛?/p> <p style="FONT-SIZE: 10pt">  鍦–++0x涓紝auto鍏抽敭瀛楃殑鎰忎箟鍙戠敓浜嗘敼鍙樸備粠Visual C++ 2010寮濮嬶紝auto鍏抽敭瀛楀皢鐢ㄤ簬鎸囧紩緙栬瘧鍣ㄦ牴鎹彉閲忕殑鍒濆鍊兼潵鍐沖畾鍙橀噺鐨勬暟鎹被鍨嬨傛崲鍙ヨ瘽璇達(dá)紝鎴戜滑鍙互鎶奱uto褰撴垚涓縐嶆柊鐨勬暟鎹被鍨嬶紝瀹冨彲浠?#8220;浠庡垵濮嬪寲鍣?initialize)涓帹瀵煎嚭鎵浠h〃鐨勫彉閲忕殑鐪熸綾誨瀷”銆傝繖縐嶅auto鍏抽敭瀛楃殑浣跨敤鏂瑰紡鍙互澶уぇ娑堥櫎褰撳墠鏇夸唬鏂瑰紡鎵瀵艱嚧鐨勫啑闀垮拰鏄撳嚭閿欑殑浠g爜銆傛垜浠湅涓涓疄闄呯殑渚嬪瓙錛?/p> <p style="FONT-SIZE: 10pt">view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>#include <iostream>   <br>#include <map>   <br>#include <ostream>   <br>#include <regex>   <br>#include <string>   <br>using namespace std;   <br>using namespace std::tr1;   <br>  <br>int main() {   <br>    map<string, string> m;   <br>  <br>    const regex r("(<a href="file://w/">\\w</a>+) (<a href="file://w/">\\w</a>+)");   <br>  <br>    for (string s; getline(cin, s); ) {   <br>        smatch results;   <br>        if (regex_match(s, results, r)) {   <br>            m[results[1]] = results[2];   <br>        }   <br>    }   <br>    for (auto i = m.begin(); i != m.end(); ++i) {   <br>        cout << i->second << " are " << i->first << endl;   <br>    }   <br>  <br>    return 0;   <br>}  <br>#include <iostream><br>#include <map><br>#include <ostream><br>#include <regex><br>#include <string><br>using namespace std;<br>using namespace std::tr1;</p> <p style="FONT-SIZE: 10pt">int main() {<br>    map<string, string> m;</p> <p style="FONT-SIZE: 10pt">    const regex r("(<a href="file://w/">\\w</a>+) (<a href="file://w/">\\w</a>+)");</p> <p style="FONT-SIZE: 10pt">    for (string s; getline(cin, s); ) {<br>        smatch results;<br>        if (regex_match(s, results, r)) {<br>            m[results[1]] = results[2];<br>        }<br>    }<br>    for (auto i = m.begin(); i != m.end(); ++i) {<br>        cout << i->second << " are " << i->first << endl;<br>    }</p> <p style="FONT-SIZE: 10pt">    return 0;<br>}<br> <br>  鍦ㄨ繖孌典唬鐮佷腑錛屾垜浠嬌鐢╝uto鍏抽敭瀛楁潵浠f浛浜嗙湡姝g殑鏁版嵁綾誨瀷map<string, string>::iterator錛岃繖浣垮緱鏁翠釜浠g爜鑷劧鑰岀畝媧併?/p> <p style="FONT-SIZE: 10pt">  鍙﹀錛岃窡鍏朵粬鏁版嵁綾誨瀷涓鏍鳳紝鎴戜滑涔熷彲浠ュauto鍏抽敭瀛楄繘琛屼慨楗幫紝渚嬪娣誨姞const錛屾寚閽?*)錛屽乏鍊煎紩鐢?&)錛屽彸鍊煎紩鐢?&&)絳夌瓑錛岀紪璇戝櫒浼?xì)鏍规嵁a(chǎn)uto綾誨瀷鎵浠h〃鐨勭湡姝g殑鏁版嵁鏉ュ喅瀹氳繖浜涗慨楗扮殑鍏蜂綋鍚箟銆?/p> <p style="FONT-SIZE: 10pt">  涓轟簡鍏煎涓浜涙棫鏈夌殑C++浠g爜錛屾垜浠彲浠ヤ嬌鐢?Zc:auto榪欎釜緙栬瘧鍣ㄩ夐」錛屾潵鍛婅瘔緙栬瘧鍣ㄦ槸閲囩敤auto鍏抽敭瀛楃殑鍘熸湁瀹氫箟榪樻槸鍦ㄦ柊鏍囧噯C++0x涓殑瀹氫箟銆?/p> <p style="FONT-SIZE: 10pt">鍙沖煎紩鐢?/p> <p style="FONT-SIZE: 10pt">  浣滀負(fù)鏈閲嶈鐨勪竴欏硅璦鐗規(guī)э紝鍙沖煎紩鐢?rvalue references)琚紩鍏ュ埌 C++0x涓傛垜浠彲浠ラ氳繃鎿嶄綔絎?#8220;&&”鏉ュ0鏄庝竴涓彸鍊煎紩鐢紝鍘熷厛鍦–++涓嬌鐢?#8220;&”鎿嶄綔絎﹀0鏄庣殑寮曠敤鐜板湪琚О涓哄乏鍊煎紩鐢ㄣ?</p> <p style="FONT-SIZE: 10pt">int a;<br>int& a_lvref = a;  // 宸﹀煎紩鐢?/p> <p style="FONT-SIZE: 10pt">int b;<br>int&& b_rvref = b;  // 鍙沖煎簲鐢?br>  宸﹀煎紩鐢ㄥ拰鍙沖煎紩鐢ㄧ殑琛ㄧ幇琛屼負(fù)鍩烘湰涓鑷達(dá)紝瀹冧滑鍞竴鐨勫樊鍒氨鏄彸鍊煎紩鐢ㄥ彲浠ョ粦瀹氬埌涓涓復(fù)鏃跺璞?鍙沖?涓婏紝鑰屽乏鍊煎紩鐢ㄤ笉鍙互銆備緥濡傦細(xì) </p> <p style="FONT-SIZE: 10pt">int& a_lvref = int();      // error C2440: 'initializing' : cannot convert from 'int' to 'int &'    <br>int&& b_rvref = int();  // OK!<br>  鍦ㄧ涓琛屼唬鐮佷腑錛屾垜浠皢涓涓復(fù)鏃跺璞nt()緇戝畾鍒頒竴涓乏鍊煎紩鐢紝灝嗕駭鐢熶竴涓紪璇戦敊璇傝屽湪絎簩琛屼腑錛屾垜浠皢涓存椂瀵硅薄緇戝畾鍒板彸鍊煎紩鐢紝灝卞彲浠ラ『鍒╅氳繃緙栬瘧銆?/p> <p style="FONT-SIZE: 10pt">  鍙沖兼槸鏃犲悕鐨勬暟鎹紝渚嬪鍑芥暟鐨勮繑鍥炲間竴鑸鏉ュ氨鏄彸鍊箋傚綋瀵瑰彸鍊艱繘琛屾搷浣滅殑鏃跺欙紝鍙沖兼湰韜線寰娌℃湁蹇呰淇濈暀錛屽洜姝ゅ湪鏌愪簺鎯呭喌涓嬪彲浠ョ洿鎺?#8220;縐誨姩”涔嬨傞氳繃鍙沖煎紩鐢紝紼嬪簭鍙互鏄庣‘鐨勫尯鍒嗗嚭浼犲叆鐨勫弬鏁版槸鍚︿負(fù)鍙沖鹼紝浠庤岄伩鍏嶄簡涓嶅繀瑕佺殑鎷瘋礉錛岀▼搴忕殑鏁堢巼涔熷氨寰楀埌浜嗘彁楂樸傛垜浠冭檻涓涓畝鍗曠殑鏁版嵁浜ゆ崲鐨勫皬紼嬪簭錛屼粠涓潵浣撲細(xì)鍙沖煎紩鐢ㄦ墍甯︽潵鐨勬晥鐜囨彁鍗囥傛垜浠彲浠ュ啓涓涓嚱鏁皊wap鏉ュ疄鐜頒袱涓彉閲忓肩殑浜ゆ崲錛?/p> <p style="FONT-SIZE: 10pt">view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>template <class T> swap(T& a, T& b)   <br>{   <br>    T tmp(a);   // tmp瀵硅薄鍒涘緩鍚庯紝鎴戜滑灝辨嫢鏈変簡a鐨勪袱浠芥嫹璐?nbsp;  <br>    a = b;      // 鐜板湪鎴戜滑鎷ユ湁b鐨勪袱浠芥嫹璐?nbsp;  <br>    b = tmp;    // 鐜板湪鎴戜滑鎷ユ湁a鐨勪袱浠芥嫹璐?nbsp;  <br>}  <br>template <class T> swap(T& a, T& b)<br>{<br>    T tmp(a);   // tmp瀵硅薄鍒涘緩鍚庯紝鎴戜滑灝辨嫢鏈変簡a鐨勪袱浠芥嫹璐?br>    a = b;      // 鐜板湪鎴戜滑鎷ユ湁b鐨勪袱浠芥嫹璐?br>    b = tmp;    // 鐜板湪鎴戜滑鎷ユ湁a鐨勪袱浠芥嫹璐?br>} <br>  鍦ㄨ繖孌典唬鐮佷腑錛岃櫧鐒舵垜浠彧鏄負(fù)浜嗚繘琛岀畝鍗曠殑鏁版嵁浜ゆ崲錛屼絾鏄嵈鎵ц浜嗗嬈″璞℃嫹璐濄傝繖浜涘璞$殑鎷瘋礉鎿嶄綔錛岀壒鍒槸褰撹繖浜涘璞℃瘮杈冨ぇ鐨勬椂鍊欙紝鏃犵枒浼?xì)濯勫搷绋嬪簭鐨勬晥鐜囥?/p> <p style="FONT-SIZE: 10pt">  閭d箞錛屽鏋滀嬌鐢ㄥ彸鍊煎紩鐢ㄥ浣曞疄鐜板憿錛?/p> <p style="FONT-SIZE: 10pt">view plaincopy to clipboardprint?<br>·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150<br>#include "stdafx.h"   <br>  <br>template <class T>    <br>T&& move(T&& a)   <br>{   <br>    return a;   <br>}   <br>  <br>template <class T> void swap(T& a, T& b)   <br>{   <br>    T tmp(move(a)); // 瀵硅薄a琚Щ鍔ㄥ埌瀵硅薄tmp錛宎琚竻絀?nbsp;  <br>    a = move(b);    // 瀵硅薄b琚Щ鍔ㄥ埌瀵硅薄a錛宐琚竻絀?nbsp;  <br>    b = move(tmp);  // 瀵硅薄tmp琚Щ鍔ㄥ埌瀵硅薄b   <br>}   <br>  <br>int _tmain(int argc, _TCHAR* argv[])   <br>{   <br>    int a = 1;   <br>    int b = 2;   <br>    swap(a, b);   <br>  <br>   return 0;   <br>}  <br>#include "stdafx.h"</p> <p style="FONT-SIZE: 10pt">template <class T> <br>T&& move(T&& a)<br>{<br>    return a;<br>}</p> <p style="FONT-SIZE: 10pt">template <class T> void swap(T& a, T& b)<br>{<br>    T tmp(move(a)); // 瀵硅薄a琚Щ鍔ㄥ埌瀵硅薄tmp錛宎琚竻絀?br>    a = move(b);    // 瀵硅薄b琚Щ鍔ㄥ埌瀵硅薄a錛宐琚竻絀?br>    b = move(tmp);  // 瀵硅薄tmp琚Щ鍔ㄥ埌瀵硅薄b<br>}</p> <p style="FONT-SIZE: 10pt">int _tmain(int argc, _TCHAR* argv[])<br>{<br>    int a = 1;<br>    int b = 2;<br>    swap(a, b);</p> <p style="FONT-SIZE: 10pt">   return 0;<br>}<br> </p> <p style="FONT-SIZE: 10pt"><br>  鍦ㄨ繖孌甸噸鏂板疄鐜扮殑浠g爜涓紝鎴戜滑浣跨敤浜嗕竴涓猰ove()鍑芥暟鏉ヤ唬鏇垮璞$殑璧嬪兼搷浣滅“=”,move()鍙槸綆鍗曞湴鎺ュ彈涓涓彸鍊煎紩鐢ㄦ垨鑰呭乏鍊煎紩鐢ㄤ綔涓哄弬鏁幫紝鐒跺悗鐩存帴榪斿洖鐩稿簲瀵硅薄鐨勫彸鍊煎紩鐢ㄣ傝繖涓榪囩▼涓嶄細(xì)浜х敓鎷瘋礉(Copy)鎿嶄綔錛岃屽彧浼?xì)灏嗘簮瀵硅薄绉诲?Move)鍒扮洰鏍囧璞°?/p> <p style="FONT-SIZE: 10pt">  姝f槸鎷瘋礉(Copy)鍜岀Щ鍔?Move)鐨勫樊鍒紝浣垮緱鍙沖煎紩鐢ㄦ垚涓篊++0x涓渶嬋鍔ㄤ漢蹇冪殑鏂扮壒鎬т箣涓銆備粠瀹炶返瑙掑害璁詫紝瀹冭兘澶熷畬緹庢槸瑙e喅C++涓暱涔呬互鏉ヤ負(fù)浜烘墍璇熺梾鐨勪復(fù)鏃跺璞$殑鏁堢巼闂銆備粠璇█鏈韓璁詫紝瀹冨仴鍏ㄤ簡C++涓殑寮曠敤綾誨瀷鍦ㄥ乏鍊煎彸鍊兼柟闈㈢殑緙洪櫡銆備粠搴撹璁¤呯殑瑙掑害璁詫紝瀹冪粰搴撹璁¤呭張甯︽潵浜嗕竴鎶婂埄鍣ㄣ傝屽浜庡箍澶х殑搴撲嬌鐢ㄨ呰岃█錛屼笉鍔ㄤ竴鍏典竴鍗掍究鑳藉鑾峰緱“鍏嶈垂鐨?#8221;鏁堢巼鎻愬崌銆?/p> <p style="FONT-SIZE: 10pt">  鍦╒isual Studio 2010涓紝鍥犱負(fù)鏈変簡瀵硅繖浜汣++0x鏂扮壒鎬х殑鏀寔錛岄噸鏂扮偣鐕冧簡紼嬪簭鍛樹滑瀵笴++鐨勭儹鎯呫侰++閲嶆尟闆勯錛屾寚鏃ュ彲寰咃紒</p> <p style="FONT-SIZE: 10pt"><br>鏈枃鏉ヨ嚜CSDN鍗氬錛岃漿杞借鏍囨槑鍑哄錛?a >http://blog.csdn.net/yincheng01/archive/2010/03/11/5367032.aspx</a></p> <p style="FONT-SIZE: 10pt"> </p> <img src ="http://www.shnenglu.com/jack-wang/aggbug/109750.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jack-wang/" target="_blank">灝忕帇</a> 2010-03-15 18:25 <a href="http://www.shnenglu.com/jack-wang/archive/2010/03/15/109750.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浠婂ぉ宸ヤ綔涓獊鐒舵彁鍒頒簡stdcall錛屾垜閮芥湁浜涘繕浜嗭紝宸偣琚富綆¢棶鍊?/title><link>http://www.shnenglu.com/jack-wang/archive/2010/01/21/106195.html</link><dc:creator>灝忕帇</dc:creator><author>灝忕帇</author><pubDate>Thu, 21 Jan 2010 15:43:00 GMT</pubDate><guid>http://www.shnenglu.com/jack-wang/archive/2010/01/21/106195.html</guid><wfw:comment>http://www.shnenglu.com/jack-wang/comments/106195.html</wfw:comment><comments>http://www.shnenglu.com/jack-wang/archive/2010/01/21/106195.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jack-wang/comments/commentRss/106195.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jack-wang/services/trackbacks/106195.html</trackback:ping><description><![CDATA[ <br /> <font size="2">姣斿 鎴戜滑鏈夎繖鏍蜂竴涓狢鍑芥暟<br />#include<stdio.h><br />long test(int a,int b)<br />{<br />    a = a + 1;<br />    b = b + 100;<br />    return a + b;<br />}<br /><br />鍐欐垚32浣嶆眹緙栧氨鏄繖鏍?br />;//////////////////////////////////////////////////////////////////////////////////////////////////////<br />.386<br />.module flat,stdcall           ;榪欓噷鎴戜滑鐢╯tdcall 灝辨槸鍑芥暟鍙傛暟 鍘嬫爤鐨勬椂鍊欎粠鏈鍚庝竴涓紑濮嬪帇錛屽拰琚皟鐢ㄥ嚱鏁拌礋璐f竻鏍?br />option casemap:none            ;鍖哄垎澶у皬鍐?br /><br />includelib msvcrt.lib          ;榪欓噷鏄紩鍏ョ被搴?#160;鐩稿綋浜?#160;#include<stdio.h>浜?#160;      <br />printf  PROTO C:DWORD,:VARARG  ;榪欎釜灝辨槸澹版槑涓涓嬫垜浠鐢ㄧ殑鍑芥暟澶達(dá)紝鍒版椂鍊?#160;姹囩紪紼嬪簭浼?xì)鑷姩鍒癿svcrt.lib閲岄潰鎵劇殑浜?#160;<br />                                ;:VARARG 琛ㄥ悗闈㈢殑鍙傛暟涓嶇‘瀹?#160;鍥犱負(fù)C灝辨槸榪欐牱鐨刾rintf(const char *, ...);<br />                               ;榪欐牱鐨勫嚱鏁拌娉ㄦ剰 涓嶆槸琚皟鐢ㄥ嚱鏁拌礋璐f竻鏍?#160;鍥犱負(fù)瀹冩湰韜笉鐭ラ亾鏈夊灝戜釜鍙傛暟<br />                               ;鑰屾槸鏈夎皟鐢ㄨ呰礋璐f竻鏍?#160; 涓嬮潰浼?xì)璇l嗚鏄?br />.data<br />szTextFmt  BYTE '%d',0        ;榪欎釜鏄敤鏉ョ被鍨嬭漿鎹㈢殑錛岃窡C鐨勪竴鏍?瀛楃鐢ㄥ瓧鑺傜被鍨?br />a          dword 1000         ;鍋囪<br />b          dword 2000         ;澶勭悊鏁板奸兘鐢ㄥ弻瀛?#160;娌℃湁int 璺焞ong 鐨勫尯鍒?br /><br />;/////////////////////////////////////////////////////////////////////////////////////////<br />.code<br /><br />_test proc A:DWORD,B:DWORD <br />      push ebp<br />      mov  ebp,esp<br />      mov  eax,dword ptr ss:[ebp+8]<br />      add  eax,1<br />      mov  edx,dword ptr ss:[ebp+0Ch]<br />      add  edx,100<br />      add  eax,edx<br />      pop  ebp      <br />      retn 8<br />_test endp<br /><br />_main proc <br />      push dword ptr ds:b       ;鍙嶆眹緙栨垜浠湅鍒扮殑b灝變笉鏄痓浜嗚屾槸涓涓猍*****]鏁板瓧 dword ptr 灝辨槸鎴戜滑鍦╠s(鏁版嵁孌?鎶奫*****]<br />                                ;寮濮嬬殑涓涓弻瀛楅暱鏁板煎彇鍑烘潵<br />      push dword ptr ds:a       ;璺熷ス瀵瑰簲鐨勮繕鏈?#160;byte ptr ****灝辨槸鍙栦竴涓瓧鑺傚嚭鏉?#160;姣斿榪欐牱 mov  al,byte ptr ds:szTextFmt <br />                                ;灝辨妸 % 鍙栧嚭鏉?#160;鑰屼笉鍖呮嫭 d<br />      call _test                  <br />      push eax                  ;鍋囪push eax鐨勫湴鍧鏄?#215;××××<br />      push offset szTextFmt<br />      call printf<br />      add  esp,8<br />      ret             <br />_main endp<br />end  _main<br /><br />;////////////////////////////////////////////////////////////// 涓嬮潰浠嬬粛鍫嗘爤鐨勫彉鍖?br />棣栧厛瑕佹槑鐧界殑鏄?#160;鎿嶄綔鍫嗘爤孌?#160;ss 鍙兘鐢?#160;esp鎴杄bp瀵勫瓨鍣?#160;鍏朵粬鐨勫瘎瀛樺櫒eax ebx edx絳夐兘涓嶈兘澶熺敤 鑰?#160;esp姘歌繙鎸囧悜鍫嗘爤鏍堥《 ebp鐢ㄦ潵 鍦ㄥ爢鏍堟<br /><br />閲岄潰瀵誨潃<br />push 鎸囦護(hù)鏄帇鏍?#160;ESP=ESP-4<br />pop  鎸囦護(hù)鏄嚭鏍?#160;ESP=ESP+4<br />鎴戜滑鍋囪main鍑芥暟涓寮濮嬪爢鏍堝畾鏄?#160;ESP=400<br />push dword ptr ds:b                 ;ESP-4=396 ->閲岄潰鐨勫煎氨鏄?#160;2000 灝辨槸b鐨勬暟鍊?br />push dword ptr ds:a                 ;ESP-4=392 ->閲岄潰鐨勫煎氨鏄?#160;1000 灝辨槸a鐨勬暟鍊?br />call test                           ;ESP-4=388錛?gt;閲岄潰鐨勬暟鍊兼槸浠涔堬紵榪欎釜澶噸瑕佷簡 灝辨槸鎴戜滑鐢ㄦ潵鎵炬父鎴忓嚱鏁扮殑鍘熺悊鎵鍦ㄣ?br />                                                 閲岄潰鐨勬暟鍊煎氨鏄痗all test 鎸囦護(hù)涓嬩竴鏉℃寚浠ょ殑鍦板潃錛?gt;鍗硃ush eax鐨勫湴鍧×××××<br /><br />鍒頒簡test鍑芥暟閲岄潰<br /><br />push ebp                           ;ESP-4=384->閲岄潰淇濆瓨浜嗗綋鍓峞bp鐨勫?#160;鑰屼笉鏄妸ebp娓呴浂<br />mov  ebp,esp                       ;榪欓噷ESP錛?84灝辨病鍙樺寲浜嗭紝浣嗘槸 ebp=esp=384,涓轟粈涔堣榪欐牱鍋氬憿 鍥犱負(fù)鎴戜滑瑕佺敤ebp鍒板爢鏍堥噷闈㈡壘鍙傛暟<br />mov  eax,dword ptr ss:[ebp+8]      ;鍙嶆眹緙栨槸榪欐牱鐨?#160;鎯蟲兂涓轟粈涔坅灝辨槸[ebp+8]鍛?br />                                   ;鎴戜滑寰涓婄湅鐪嬪爢鏍堥噷鍦板潃392澶勫氨淇濆瓨鐫a鐨勫?#160;榪欓噷ebp=384 鍔犱笂8姝eソ灝辨槸392浜?br />                                   ;榪欐牱灝辨妸浼犻掕繃鏉ョ殑1000鎷夸簡鍑烘潵eax=1000<br />add  eax,1                         ;鐩稿綋浜?#160;a+1浜?#160;eax=1001<br />mov  edx,dword ptr ss:[ebp+0Ch]    ; 0Ch=12 涓鏍烽亾鐞嗚繖閲屾寚鍚戝爢鏍堢殑鍦板潃鏄?84+12=396 灝辨槸2000浜?#160;edx=2000<br />add  edx,100                       ;鐩稿綋浜?#160;b+100 edx=2100<br />add  eax,edx                       ;eax=eax+edx錛?001錛?100錛?101 榪欓噷eax宸茬粡淇濆瓨浜嗘渶緇堢殑緇撴灉浜?#160;<br />                                   ;鍥犱負(fù)win32姹囩紪涓鑸敤eax榪斿洖緇撴灉 鎵浠ュ鏋滄渶緇堢粨鏋滀笉鏄湪eax閲岄潰鐨勮瘽 榪樿鎶婂畠鏀懼埌eax<br />                                   ;姣斿鍋囪鎴戠殑緇撴灉淇濆瓨鍦ㄥ彉閲弉Ret閲岄潰 鏈鍚庤繕鏄榪欐牱 mov eax,dword ptr nRet<br />pop  ebp                           ;ESP=384+4=388 鑰屼繚瀛樺湪鏍堥《384鐨勫?#160;淇濆瓨鍒?#160;ebp涓?#160;鍗蟲仮澶峞bp鍘熸潵鐨勫?#160;                      <br />                                   ;鍥犱負(fù)涓寮濮嬫垜浠氨鎶奺bp鐨勫煎帇鏍堜簡錛宮ov ebp,esp宸茬粡鏀瑰彉浜唀bp鐨勫鹼紝榪欓噷鎭㈠灝辨槸淇濊瘉浜嗗爢鏍堝鉤琛?br />retn  8                            ;ESP+8->396 榪欓噷retn鏄敱緋葷粺璋冪敤鐨?#160;鎴戜滑涓嶇敤綆?#160;緋葷粺浼?xì)鑷姩鎶奅IP鎸囬拡鎸囧悜 鍘熸潵鐨刢all鐨勪笅涓鏉℃寚浠?br />                                   ;鐢變簬鏄郴緇熻嚜鍔ㄦ仮澶嶄簡call閭i噷鐨勫帇鏍堟墍浠?#160;鐪熸榪斿洖鍒扮殑鏃跺橢SP+4灝辨槸鎭㈠浜哻all鍘嬫爤鐨勫爢鏍?br />                                   ;鍒頒簡榪欎釜鏃跺?#160;ESP=400 灝辨槸鍑芥暟璋冪敤寮濮嬬殑鍫嗘爤錛屽氨鏄鍑芥暟璋冪敤鍓嶈窡鍑芥暟璋冪敤鍚庣殑鍫嗘爤鏄竴鏍風(fēng)殑<br />                                   ;榪欏氨鏄爢鏍堝鉤琛?#160;<br />鐢變簬鎴戜滑鐢╯tdcall涓婇潰retn 8灝辨槸琚皟鐢ㄨ呰礋璐f仮澶嶅爢鏍堢殑鎰忔濅簡錛屽嚱鏁皌est鏄璋冪敤鑰咃紝鎵浠ヨ礋璐f妸鍫嗘爤鍔?,call 閭i噷鏄郴緇熻嚜鍔ㄦ仮澶嶇殑<br /><br />push eax                ;ESP-4=396->閲岄潰淇濆瓨浜唀ax鐨勫?101<br />                        ;涓婇潰宸茬粡鐪嬪埌浜唀ax淇濆瓨鐫榪斿洖鍊鹼紝鎴戜滑瑕佹妸瀹冧紶緇檖rintf涔熸槸閫氳繃鍫嗘爤浼犻?#160;      <br />push offset szTextFmt   ;ESP-4=392->閲岄潰淇濆瓨浜唖zTextFmt鐨勫湴鍧 涔熷氨鏄疌閲岄潰鐨勬寚閽?#160;瀹為檯涓婃病鏈変粈涔堟妸瀛楃涓蹭紶閫掔殑錛屾垜浠紶鐨勯兘鏄湴鍧<br />                        ;鏃犺鏄湪姹囩紪鎴朇 鎵浠ュ湪姹囩紪閲屾病鏈変粈涔堝瓧絎︿覆綾誨瀷 鐢ㄦ渶澶氱殑灝辨槸DWORD銆傚樋鍢挎父鎴忛噷闈紶閫掑弬鏁?#160;綆鍗曞浜?br />call printf             ;ESP-4=388->閲岄潰淇濆瓨浜嗕笅涓鏉℃寚浠ょ殑鍦板潃<br />add  esp,8              ;ESP+8=400 鎭㈠浜嗚皟鐢╬rintf鍓嶇殑鍫嗘爤鐘舵?br />                        ;涓婇潰璇翠簡鐢變簬printf鍚庨潰鍙傛暟鏄?VARARG 榪欐牱鐨勭被鍨嬫槸鏈夎皟鐢ㄨ呮仮澶嶅爢鏍堢殑 鎵浠rintf閲岄潰娌℃湁retn 8涔嬬被鐨勬寚浠?br />                        ;榪欐槸鐢辮皟鐢ㄨ呰礋璐f竻鏍?#160;main鏄皟鐢ㄨ?#160;鎵浠ヤ笅闈竴鍙ュ氨鏄?#160;add esp,8 鎶婂爢鏍堟仮澶嶅埌璋冪敤printf涔嬪墠<br />                        ;鑰宑all printf閭i噷鐨勫帇鏍?#160;鏄敱緋葷粺鍋氱殑 鎭㈠鐨勫伐浣滀篃鏄郴緇熷畬鎴?#160;鎴戜滑涓嶇敤鐞?#160;鍙槸鐭ラ亾閲岄潰淇濆瓨鏄繑鍥炲湴鍧灝卞  <br /><br />                      ;浜?br />ret                     ;main 鍑芥暟榪斿洖 鍏朵粬鐨勪簨鎯呮槸緋葷粺鑷姩鎼炲畾 鎴戜滑涓嶇敤鐞?#160;浠誨姟瀹屾垚<br /></font> <img src ="http://www.shnenglu.com/jack-wang/aggbug/106195.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jack-wang/" target="_blank">灝忕帇</a> 2010-01-21 23:43 <a href="http://www.shnenglu.com/jack-wang/archive/2010/01/21/106195.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏈蹇熷害鎵懼埌鍐呭瓨娉勬紡http://www.shnenglu.com/jack-wang/archive/2010/01/21/106191.html灝忕帇灝忕帇Thu, 21 Jan 2010 15:14:00 GMThttp://www.shnenglu.com/jack-wang/archive/2010/01/21/106191.htmlhttp://www.shnenglu.com/jack-wang/comments/106191.htmlhttp://www.shnenglu.com/jack-wang/archive/2010/01/21/106191.html#Feedback0http://www.shnenglu.com/jack-wang/comments/commentRss/106191.htmlhttp://www.shnenglu.com/jack-wang/services/trackbacks/106191.html 鍘熷笘錛?a >http://blog.csdn.net/i_like_cpp/archive/2007/06/28/1669962.aspx
浣滆咃細(xì)璁稿紡浼?2006騫?1鏈堟煇鏃?/font>

鍐呭瓨綆$悊鏄疌++紼嬪簭鍛樼殑鐥涖傛垜鐨勩婂唴瀛樼鐞嗗彉闈┿嬬郴鍒楀氨鏄瘯鍥捐璁烘洿涓烘湁鏁堢殑鍐呭瓨綆$悊鏂瑰紡錛屼互鏉滅粷錛堟垨鍑忓皯錛夊唴瀛樻硠婕忥紝鍑忚交C++紼嬪簭鍛樼殑璐熸媴銆傜敱浜庡伐浣滃繖鐨勭紭鏁咃紝榪欎釜緋誨垪鐩墠鏈畬錛屾殏鍋溿?br />聽
榪欑瘒鐭枃鎴戞兂鎹釜鏂瑰紡錛岃璁轟竴涓嬪浣曚互鏈蹇殑閫熷害鎵懼埌鍐呭瓨娉勬紡銆?br />聽
紜鏄惁瀛樺湪鍐呭瓨娉勬紡
鎴戜滑鐭ラ亾錛孧FC紼嬪簭濡傛灉媯嫻嬪埌瀛樺湪鍐呭瓨娉勬紡錛岄鍑虹▼搴忕殑鏃跺欎細(xì)鍦ㄨ皟璇曠獥鍙f彁閱掑唴瀛樻硠婕忋備緥濡傦細(xì)

class CMyApp : public CWinApp
{
public:
聽聽 BOOL InitApplication()
聽聽 {
聽聽聽聽聽聽 int* leak = new int[10];
聽聽聽聽聽聽 return TRUE;
聽聽 }
};
浜х敓鐨勫唴瀛樻硠婕忔姤鍛婂ぇ浣撳涓嬶細(xì)

Detected memory leaks!
Dumping objects ->
c:\work\test.cpp(186) : {52} normal block at 0x003C4410, 40 bytes long.
聽Data: <聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
榪欐尯濂姐傞棶棰樻槸錛屽鏋滄垜浠笉鍠滄MFC錛岄偅涔堥毦閬撳氨娌℃湁鍔炴硶錛熸垨鑰呰嚜宸卞仛錛?

鍛靛懙錛岃繖涓嶉渶瑕併傚叾瀹烇紝MFC涔熸病鏈夎嚜宸卞仛銆傚唴瀛樻硠婕忔嫻嬬殑宸ヤ綔鏄疺C++鐨凜榪愯搴撳仛鐨勩備篃灝辨槸璇達(dá)紝鍙浣犳槸VC++紼嬪簭鍛橈紝閮藉彲浠ュ緢鏂逛究鍦版嫻嬪唴瀛樻硠婕忋傛垜浠繕鏄粰涓牱渚嬶細(xì)

#include <crtdbg.h>

inline void EnableMemLeakCheck()
{
聽聽 _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}

void main()
{
聽聽 EnableMemLeakCheck();
聽聽 int* leak = new int[10];
}
聽榪愯錛堟彁閱掞細(xì)涓嶈鎸塁trl+F5錛屾寜F5錛夛紝浣犲皢鍙戠幇錛屼駭鐢熺殑鍐呭瓨娉勬紡鎶ュ憡涓嶮FC綾諱技錛屼絾鏈夌粏鑺備笉鍚岋紝濡備笅錛?/font>

Detected memory leaks!
Dumping objects ->
{52} normal block at 0x003C4410, 40 bytes long.
聽Data: <聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
涓轟粈涔堝憿錛熺湅涓嬮潰銆?/font>

瀹氫綅鍐呭瓨娉勬紡鐢變簬鍝竴鍙ヨ瘽寮曡搗鐨?br />浣犲凡緇忓彂鐜扮▼搴忓瓨鍦ㄥ唴瀛樻硠婕忋傜幇鍦ㄧ殑闂鏄紝鎴戜滑瑕佹壘娉勬紡鐨勬牴婧愩?/font>

涓鑸垜浠鍏堢‘瀹氬唴瀛樻硠婕忔槸鐢變簬鍝竴鍙ュ紩璧楓傚湪MFC涓紝榪欎竴鐐瑰緢瀹規(guī)槗銆備綘鍙屽嚮鍐呭瓨娉勬紡鎶ュ憡鐨勬枃瀛楋紝鎴栬呭湪Debug紿楀彛涓寜F4錛孖DE灝卞府浣犲畾浣嶅埌鐢寵璇ュ唴瀛樺潡鐨勫湴鏂廣傚浜庝笂渚嬶紝涔熷氨鏄繖涓鍙ワ細(xì)

聽聽 int* leak = new int[10];

榪欏澶氬皯灝戝浣犲垎鏋愬唴瀛樻硠婕忔湁鐐瑰府鍔┿傜壒鍒湴錛屽鏋滆繖涓猲ew浠呭搴斾竴鏉elete錛堟垨鑰呬綘鎶奷elete婕忓啓錛夛紝榪欏皢寰堝揩鍙互紜闂鐨勭棁緇撱?

鎴戜滑鍓嶉潰宸茬粡鐪嬪埌錛屼笉浣跨敤MFC鐨勬椂鍊欙紝鐢熸垚鐨勫唴瀛樻硠婕忔姤鍛婁笌MFC涓嶅悓錛岃屼笖浣犵珛鍒誨彂鐜版寜F4涓嶇伒銆傞偅涔堥毦閬揗FC鍋氫簡浠涔堟墜鑴氾紵

鍏跺疄涓嶆槸錛屾垜浠潵妯℃嫙涓婱FC鍋氱殑浜嬫儏銆傜湅涓嬩緥錛?

inline void EnableMemLeakCheck()
{
聽聽 _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}

#ifdef _DEBUG
#define new聽聽 new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif

void main()
{
聽聽 EnableMemLeakCheck();
聽聽 int* leak = new int[10];
}

鍐嶈繍琛岃繖涓牱渚嬶紝浣犳儕鍠滃湴鍙戠幇錛岀幇鍦ㄥ唴瀛樻硠婕忔姤鍛婂拰MFC娌℃湁浠諱綍鍒嗗埆浜嗐?/font>

蹇熸壘鍒板唴瀛樻硠婕?br />鍗曠‘瀹氫簡鍐呭瓨娉勬紡鍙戠敓鍦ㄥ摢涓琛岋紝鏈夋椂鍊欏茍涓嶈凍澶熴傜壒鍒槸鍚屼竴涓猲ew瀵瑰簲鏈夊澶勯噴鏀劇殑鎯呭艦銆傚湪瀹為檯鐨勫伐紼嬩腑錛屼互涓嬩袱縐嶆儏鍐靛緢鍏稿瀷錛?

鍒涘緩瀵硅薄鐨勫湴鏂規(guī)槸涓涓被宸ュ巶錛圕lassFactory錛夋ā寮忋傚緢澶氱敋鑷沖叏閮ㄧ被瀹炰緥鐢卞悓涓涓猲ew鍒涘緩銆傚浜庢錛屽畾浣嶅埌浜唍ew鍑哄璞$殑鎵鍦ㄨ鍩烘湰娌℃湁澶氬ぇ甯姪銆?

COM瀵硅薄銆傛垜浠煡閬揅OM瀵硅薄閲囩敤Reference Count緇存姢鐢熷懡鍛ㄦ湡銆備篃灝辨槸璇達(dá)紝瀵硅薄new鐨勫湴鏂瑰彧鏈変竴涓紝浣嗘槸Release鐨勫湴鏂瑰緢澶氾紝浣犺涓涓釜鎺掗櫎銆?
閭d箞錛屾湁浠涔堝ソ鍔炴硶錛屽彲浠ヨ繀閫熷畾浣嶅唴瀛樻硠婕忥紵

絳旓細(xì)鏈夈?/font>

鍦ㄥ唴瀛樻硠婕忔儏鍐靛鏉傜殑鏃跺欙紝浣犲彲浠ョ敤浠ヤ笅鏂規(guī)硶瀹氫綅鍐呭瓨娉勬紡銆傝繖鏄垜涓漢璁や負(fù)閫氱敤鐨勫唴瀛樻硠婕忚拷韙柟娉曚腑鏈鏈夋晥鐨勬墜孌點?/font>

鎴戜滑鍐嶅洖澶寸湅鐪媍rtdbg鐢熸垚鐨勫唴瀛樻硠婕忔姤鍛婏細(xì)

Detected memory leaks!
Dumping objects ->
c:\work\test.cpp(186) : {52} normal block at 0x003C4410, 40 bytes long.
聽Data: <聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
闄や簡浜х敓璇ュ唴瀛樻硠婕忕殑鍐呭瓨鍒嗛厤璇彞鎵鍦ㄧ殑鏂囦歡鍚嶃佽鍙蜂負(fù)錛屾垜浠敞鎰忓埌鏈変竴涓瘮杈冮檶鐢熺殑淇℃伅錛歿52}銆傝繖涓暣鏁板間唬琛ㄤ簡浠涔堟剰鎬濆憿錛?/font>

鍏跺疄錛屽畠浠h〃浜嗙鍑犳鍐呭瓨鍒嗛厤鎿嶄綔銆傝薄榪欎釜渚嬪瓙錛寋52}浠h〃浜嗙52嬈″唴瀛樺垎閰嶆搷浣滃彂鐢熶簡娉勬紡銆備綘鍙兘瑕佽錛屾垜鍙猲ew榪囦竴嬈★紝鎬庝箞浼?xì)鏄W?2嬈★紵榪欏緢瀹規(guī)槗鐞嗚В錛屽叾浠栫殑鍐呭瓨鐢寵鎿嶄綔鍦–鐨勫垵濮嬪寲榪囩▼璋冪敤鐨勫憲銆?)

鏈夋病鏈夊彲鑳斤紝鎴戜滑璁╃▼搴忚繍琛屽埌絎?2嬈″唴瀛樺垎閰嶆搷浣滅殑鏃跺欙紝鑷姩鍋滀笅鏉ワ紝榪涘叆璋冭瘯鐘舵侊紵鎵騫革紝crtdbg紜疄鎻愪緵浜嗚繖鏍風(fēng)殑鍑芥暟錛氬嵆 long _CrtSetBreakAlloc(long nAllocID)銆傛垜浠姞涓婂畠錛?/font>

inline void EnableMemLeakCheck()
{
聽聽 _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}

#ifdef _DEBUG
#define new聽聽 new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif

void main()
{
聽聽 EnableMemLeakCheck();
聽聽 _CrtSetBreakAlloc(52);
聽聽 int* leak = new int[10];
}
浣犲彂鐜幫紝紼嬪簭榪愯鍒?int* leak = new int[10]; 涓鍙ユ椂錛岃嚜鍔ㄥ仠涓嬫潵榪涘叆璋冭瘯鐘舵併傜粏緇嗕綋浼?xì)涓涓嬶紝浣犲彲浠ュ彂鐜幫紝榪欑鏂瑰紡浣犺幏寰楃殑淇℃伅榪滄瘮鍦ㄧ▼搴忛鍑烘椂鑾峰緱鏂囦歡鍚嶅強(qiáng)琛屽彿鏈変環(huán)鍊煎緱澶氥傚洜涓烘姤鍛婃硠婕忔枃浠跺悕鍙?qiáng)琛屽忴P紝浣犺幏寰楃殑鍙槸闈欐佺殑淇℃伅錛岀劧鑰宊CrtSetBreakAlloc鍒欐槸鎶婃暣涓幇鍦烘仮澶嶏紝浣犲彲浠ラ氳繃瀵瑰嚱鏁拌皟鐢ㄦ爤鍒嗘瀽錛堟垜鍙戠幇寰堝浜轟笉涔?fàn)鎯湅鍑芥暟璋冪敤鏍堝Q屽鏋滀綘灞炰簬榪欑鎯呭喌錛屾垜寮虹儓鎺ㄨ崘浣犲幓琛ヤ笂榪欎竴璇撅紝鍥犱負(fù)瀹冨お閲嶈浜嗭級浠ュ強(qiáng)鍏朵粬鍦ㄧ嚎璋冭瘯鎶宸э紝鏉ュ垎鏋愪駭鐢熷唴瀛樻硠婕忕殑鍘熷洜銆傞氬父鎯呭喌涓嬶紝榪欑鍒嗘瀽鏂規(guī)硶鍙互鍦?鍒嗛挓鍐呮壘鍒拌倗浜嬭呫?/font>

褰撶劧錛宊CrtSetBreakAlloc瑕佹眰浣犵殑紼嬪簭鎵ц榪囩▼鏄彲榪樺師鐨勶紙澶氭鎵ц榪囩▼鐨勫唴瀛樺垎閰嶉『搴忎笉浼?xì)鍙戠敓鍙樺寲锛夈傝繖涓亣璁懼湪澶氭暟鎯呭喌涓嬫垚绔嬨備笉榪囷紝鍦ㄥ綰跨▼鐨勬儏鍐典笅錛岃繖涓鐐規(guī)湁鏃墮毦浠ヤ繚璇併?/font>


闄勫姞璇存槑錛?br />瀵光滃唴瀛樼鐞嗏濈浉鍏崇殑鎶鏈劅鍏磋叮錛熻繖閲屽彲浠ョ湅鍒版垜鐨勬墍鏈夊叧浜庡唴瀛樼鐞嗙殑鏂囩珷銆?/font>

鏈枃鏉ヨ嚜CSDN鍗氬錛岃漿杞借鏍囨槑鍑哄錛?/font> http://blog.csdn.net/i_like_cpp/archive/2007/06/28/1669962.aspx



灝忕帇 2010-01-21 23:14 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              99视频精品在线| 亚洲永久免费av| 一区二区视频免费在线观看| 亚洲综合好骚| 午夜天堂精品久久久久| 国产精品久久久久久久久免费桃花| 91久久一区二区| 亚洲精品久久久蜜桃| 老色鬼久久亚洲一区二区| 美日韩精品免费| 在线免费不卡视频| 久久综合色影院| 欧美激情 亚洲a∨综合| 国内精品免费午夜毛片| 久久精品91久久久久久再现| 久久尤物视频| 亚洲国产高清视频| 另类专区欧美制服同性| 亚洲黄色在线观看| 亚洲在线电影| 国产一区二区三区精品欧美日韩一区二区三区 | 久久精品国语| 久久爱另类一区二区小说| 国产亚洲精品久久飘花| 久久久久久夜| 亚洲精品美女免费| 亚洲欧洲在线播放| 欧美视频在线观看一区| 亚洲欧美在线另类| 久热re这里精品视频在线6| 亚洲国产一区二区三区高清| 狂野欧美激情性xxxx| 亚洲国产视频a| 亚洲欧洲av一区二区三区久久| 国产乱码精品一区二区三| 欧美亚洲一区二区在线| 欧美不卡在线| 亚洲天堂网在线观看| 国产日韩欧美一区| 香蕉乱码成人久久天堂爱免费| 女女同性女同一区二区三区91| 夜色激情一区二区| 国产精品网站在线观看| 久久婷婷一区| 亚洲午夜一区二区| 久久免费国产| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 久久久中精品2020中文| 亚洲精品一区二区三区蜜桃久| 国产精品久久久久久久久久三级| 久久成人精品电影| 亚洲人成在线观看一区二区| 欧美一区二区三区电影在线观看| 亚洲福利在线视频| 国产精品伦理| 欧美成人精品在线观看| 亚洲一区二区3| 欧美成人午夜激情| 午夜宅男久久久| 亚洲精品1234| 国产日韩欧美在线看| 蜜月aⅴ免费一区二区三区| 亚洲色诱最新| 亚洲国产cao| 久久色在线播放| 亚洲日本欧美| 在线免费观看一区二区三区| 国产精品久久久久久av下载红粉 | 亚洲综合第一页| 亚洲欧洲在线观看| 免费在线一区二区| 久久成人18免费网站| 一本综合久久| 亚洲国产你懂的| 国产精品每日更新在线播放网址| 欧美不卡视频一区发布| 久久久福利视频| 亚洲一区二区三区精品视频| 亚洲精品资源美女情侣酒店| 欧美凹凸一区二区三区视频| 欧美在线视频日韩| 亚洲一区精品电影| 亚洲毛片av在线| 一区二区高清| 亚洲一区二区视频| 欧美一区二区三区免费视| 性色一区二区| 久久精品国产精品亚洲| 美女图片一区二区| 亚洲第一区在线| 日韩视频一区二区三区在线播放免费观看 | 亚洲一区二区三区高清不卡| 亚欧成人精品| 久久香蕉国产线看观看av| 蜜桃av综合| 欧美日韩中文在线观看| 国产伦精品一区二区三区高清| 国产亚洲成人一区| 亚洲国产专区校园欧美| 一区二区三区高清在线| 欧美怡红院视频一区二区三区| 久久夜色精品一区| 亚洲级视频在线观看免费1级| 一本一本久久a久久精品综合麻豆| 亚洲欧美日韩国产成人| 狂野欧美激情性xxxx欧美| 欧美日韩免费观看一区=区三区| 国产精品日韩在线播放| 亚洲大胆女人| 亚洲综合色激情五月| 久久免费国产| 日韩亚洲在线观看| 久久久精品网| 欧美日韩在线一区二区| 国内精品久久久久久久97牛牛| 亚洲精品之草原avav久久| 亚洲自拍偷拍一区| 蜜桃伊人久久| 亚洲天堂网站在线观看视频| 久久久免费观看视频| 欧美性一二三区| 亚洲大胆av| 先锋影院在线亚洲| 亚洲高清网站| 久久国产精品黑丝| 欧美日韩亚洲网| 136国产福利精品导航| 亚洲在线观看视频网站| 亚洲丰满少妇videoshd| 欧美一区二区三区四区在线| 欧美日韩亚洲成人| 亚洲国产精品嫩草影院| 久久高清福利视频| 亚洲精品国产品国语在线app| 久久爱91午夜羞羞| 国产精品久99| 99国产精品视频免费观看| 久久琪琪电影院| 亚洲小少妇裸体bbw| 欧美精品日韩三级| 亚洲国产福利在线| 久久亚洲精品欧美| 亚洲欧美成人| 国产精品成人v| 99精品福利视频| 欧美黄色免费网站| 久久久久久夜| 黄色日韩在线| 欧美一区二区黄| 亚洲视频在线视频| 欧美日韩一区二区精品| 日韩亚洲不卡在线| 亚洲经典在线| 欧美福利一区二区三区| 亚洲国产精品va在线看黑人| 麻豆91精品| 久久精品一区二区| 好吊色欧美一区二区三区四区| 欧美一级久久久| 亚洲在线1234| 国产欧美在线视频| 欧美一区二区三区四区高清| 亚洲网站在线播放| 国产精自产拍久久久久久| 亚洲欧美日韩一区二区三区在线观看| 日韩午夜电影| 欧美日韩在线视频观看| 一区二区三区精品视频在线观看| 91久久精品一区二区别| 欧美精品一区二区视频 | 亚洲夜间福利| 在线视频欧美一区| 国产精品视频内| 欧美一区二区免费视频| 欧美一级淫片播放口| 国产日韩欧美电影在线观看| 久久精品99| 久久久久久久精| 亚洲国产高潮在线观看| 亚洲国产婷婷| 欧美日韩一区二区国产| 先锋影音国产一区| 久久精品导航| 91久久一区二区| 亚洲精品视频在线| 国产精品视频99| 久久一区二区三区四区五区| 久久综合亚州| 99热精品在线观看| 亚洲一区二区伦理| 伊人婷婷久久| 亚洲美女福利视频网站| 国产精品网曝门| 欧美成人小视频| 欧美日韩成人在线观看| 香蕉久久久久久久av网站| 久久精品国产清自在天天线| 亚洲国产精品久久久久婷婷老年| 一区二区三区av| 韩国av一区二区|