锘??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩午夜精品,亚洲国产精品久久久久久女王,久久精品女人天堂http://m.shnenglu.com/shongbee2/category/10032.html鏉備竷鏉傚叓zh-cnSat, 11 Dec 2010 22:32:37 GMTSat, 11 Dec 2010 22:32:37 GMT60API鍥炶皟鎴愬憳鍑芥暟 THUNKhttp://m.shnenglu.com/shongbee2/archive/2010/12/11/136157.htmlshongbee2shongbee2Sat, 11 Dec 2010 08:14:00 GMThttp://m.shnenglu.com/shongbee2/archive/2010/12/11/136157.htmlhttp://m.shnenglu.com/shongbee2/comments/136157.htmlhttp://m.shnenglu.com/shongbee2/archive/2010/12/11/136157.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/136157.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/136157.htmlAPI鍙兘鍥炶皟鍏ㄥ眬鍑芥暟錛岃屾垜浠湁鏃跺欏笇鏈涗粬鑳藉洖璋冩垚鍛樺嚱鏁般傛渶甯哥敤鐨勫氨鏄?/font>Timmer鍜岀獥鍙e洖璋冦傝瀹炵幇榪欎釜闇姹傦紝灝變細鐢ㄥ埌THUNK鎶鏈?/font>THUNK 鎴戞煡浜嗕竴涓嬫槸錛?/font>thunk  鍚嶈瘝 n.  閾?/font>;閾?/font>,閿?銆傝窡榪欎釜瀹屽叏娌℃湁鍏崇郴鍢涳紙鐪嬫潵鑻辨枃澶儌鏄潖澶勮繕鏄尯澶氱殑錛夈傚涔犱簡涓涓嬩箣鍚庯紝鎴戠悊瑙g殑鎰忔濆氨鏄細鐙哥尗鎹㈠お瀛愩傛浛鎹㈠師鏉ユ剰鍥撅紝杞皟鎴戜滑闇瑕佺殑鍦板潃銆?/font>

Thunk鐨勫師鐞嗗叾瀹炶璧鋒潵寰堢畝鍗曪細宸у鐨勫皢鏁版嵁孌電殑鍑犱釜瀛楄妭鐨勬暟鎹涓虹壒孌婄殑鍊鹼紝鐒跺悗鍛婅瘔緋葷粺錛岃繖鍑犱釜瀛楄妭鐨勬暟鎹槸浠g爜錛堝嵆灝嗕竴涓嚱鏁版寚閽堟寚鍚戣繖鍑犱釜瀛楄妭鐨勭涓涓瓧鑺傦級錛岃緋葷粺鏉ユ墽琛?/font>銆?/span>

璁?font face="Times New Roman">API鍥炶皟鎴愬憳鍑芥暟錛?/font>

鐩存帴鐢ㄦ垚鍛樺嚱鏁扮殑鍦板潃浼犵粰浣滀負API鐨勫洖璋冨嚱鏁版樉鐒朵細緙栬瘧鍑洪敊鐨勶紝鍘熷洜鏄粬浠殑璋冪敤瑙勫垯涓嶄竴鑷達紝C++緙栬瘧鍣ㄤ笉鍏佽榪欐牱鍋氥傚叿浣撳彲浠ュ弬鑰冿細

http://hi.baidu.com/shongbee2/blog/item/7867de9744e3c26155fb9611.html

鑰屽垰濂?font face="Times New Roman">THUNK鎶鏈氨鏄鏁版嵁孌靛綋鍋氫唬鐮佹柇鐢紝濡傛灉鎴戞妸鍥炶皟鍑芥暟鍦板潃鐢ㄤ竴涓暟鎹緇欎粬錛岀劧鍚庡湪鏁版嵁孌典腑鍐嶈煩杞埌鎴愬憳鍑芥暟鐨勫湴鍧銆傝繖鏍峰氨鍙互闂存帴鐨勮皟鐢ㄦ垚鍛樺嚱鏁頒簡銆備笉閿欙紝鎴戝氨鏄涔犵殑榪欎釜鏂規硶銆傚樆鍢匯傘?/font>

澶ц嚧鏂瑰悜鐭ラ亾浜嗭紝榪樺緱浜嗚В涓涓嬬粏鑺傦紝鍑芥暟璋冪敤鐨勮鍒欙細

寤鴻鐪嬩竴涓?/span>http://hi.baidu.com/shongbee2/blog/item/7867de9744e3c26155fb9611.html錛堜篃灝辨槸涓婁竴綃囨枃绔犲暒銆傦級闇瑕佹敞鎰忕殑錛氳皟鐢ㄨ呮庝箞澶勭悊鏍堬紝琚皟鐢ㄨ呮庝箞浣跨敤鏍堝拰澶勭悊鏍堛傜郴緇熷洖璋冨嚱鏁板熀鏈笂閮芥槸_stdcall鐨勮皟鐢ㄦ柟寮忥紝鎴愬憳鍑芥暟鏄?/font>__thiscall鐨勮皟鐢ㄦ柟寮忋備粬浠殑鍖哄埆涓猴細

鍏抽敭瀛?/span>

鍫嗘爤娓呴櫎

鍙傛暟浼犻?/span>

__stdcall

琚皟鐢ㄨ?/span>

灝嗗弬鏁板掑簭鍘嬪叆鍫嗘爤(鑷彸鍚戝乏)

__thiscall

琚皟鐢ㄨ?/span>

鍘嬪叆鍫嗘爤錛?/span>this鎸囬拡淇濆瓨鍦?ECX 瀵勫瓨鍣ㄤ腑

鍙戠幇浠栦滑鍞竴涓嶅悓鐨勫氨鏄?font face="Times New Roman">__thiscall鎶?/font>this鎸囬拡淇濆瓨鍒頒簡ECX鐨勫瘎瀛樺櫒涓傚叾浠栭兘鏄竴鏍風殑銆傝繖縐嶆儏鍐墊垜浠氨鏂逛究浜嗭紝鎴戜滑鍙渶鍦ㄤ粬璋冪敤鎴戜滑鐨勬椂鍊欙紝鎴戜滑鍚?/font>this鎸囬拡淇濆瓨鍒?/font>ECX錛岀劧鍚庤煩杞埌鏈熸湜鐨勬垚鍛樺嚱鏁板湴鍧灝卞彲浠ヤ簡銆?/font>

//鎴戣涓烘濊礬灝辨槸榪欐牱浜嗐傛帴涓嬫潵鏄疄鐜幫紝璐存簮浠g爜錛?/font>

#include "stdafx.h"
#include "wtypes.h"

#include <iostream>
using namespace std;

typedef void (*FUNC)(DWORD dwThis);
typedef int (_stdcall *FUNC1)(int a, int b);
#pragma pack(push,1)
typedef struct tagTHUNK
{
    BYTE    bMovEcx;   //MOVE ECX 灝唗his鎸囬拡縐誨姩鍒癊CX鐨勬寚浠?br>    DWORD    dwThis;   // this   this鎸囬拡鐨勫湴鍧
    BYTE    bJmp;    //jmp   璺寵漿鎸囦護
    DWORD    dwRealProc; //proc offset 璺寵漿鍋忕Щ

    void Init(DWORD proc,void* pThis)
    {
   bMovEcx = 0xB9;        //娉ㄩ噴瑙佷笅闈㈣鏄巀_^
        dwThis = (DWORD)pThis;
        bJmp = 0xE9;
        dwRealProc = DWORD((INT_PTR)proc - ((INT_PTR)this+sizeof(THUNK)));
        FlushInstructionCache(GetCurrentProcess(),this,sizeof(THUNK));
    }
}THUNK;
#pragma pack(pop)
/**************************************************************************************
void Init(DWORD proc,void* pThis)閲岄潰鐨勮鏄庯細
0xB9 涓篗OVE ECX鐨勬寚浠わ紝 0xE9 璺寵漿鐨勬寚浠わ紝榪欐鍒濆鍖栬〃紺猴細
0013FF54 mov         ecx, ptr [this]
0013FF59 jmp         dwRealProc
榪欎釜鍗曟涓涓嬩究鐭ャ?br>涓嬮潰閭d釜API 錛欶lushInstructionCache錛屾煡MSDN錛岃〃紺哄埛鏂扮紦瀛橈紝
鍥犱負鎴戜滑淇敼浜嗘暟鎹紝寤鴻浠栭噸鏂拌澆鍏ヤ竴涓嬨?/span>

鎴戞渶涓嶈兘鐞嗚В鐨勬槸jmp鐨勫亸縐繪槸涓轟粈涔堟槸閭f牱璁$畻錛屾墍浠ヨ繖閲屼篃鐫閲嶈鏄庝竴涓嬶細
jmp璺寵漿鐨勬槸褰撳墠鎸囦護鍦板潃鐨勫亸縐伙紝鎴戜滑鍙傛暟涓璸roc鏄疄闄呭嚱鏁扮殑鍦板潃錛屾垜浠渶瑕?br>鎶婁粬杞負jmp鐨勫亸縐? 瀹為檯鍑芥暟鍦板潃-jmp鎸囦護鍦板潃銆?br>瀹為檯鍑芥暟鍦板潃灝辨槸proc,jmp鍦板潃灝辨槸((INT_PTR)this+sizeof(THUNK))錛屾墍浠ュ氨寰楀埌
dwRealProc = DWORD((INT_PTR)proc - ((INT_PTR)this+sizeof(THUNK)));榪欒浠g爜
榪樻湁涓鐐癸紝鎴戝姹囩紪涓嶄簡瑙o紝涓嬮潰鏄痀Y錛氫負浠涔堜笉鏄細
dwRealProc = DWORD((INT_PTR)proc - ((INT_PTR)this+sizeof(THUNK)) - sizeof(dwRealProc))
鐩磋涓婄湅jmp鍦板潃涓嶆槸錛歵his + sizeof(bMoveEcx) + sizeof(dwThis) + sizeof(bJmp)鍚楋紵
涔熷氨鏄?(INT_PTR)this+sizeof(THUNK)) - sizeof(dwRealProc) 鍟娿傚彲鏄垜鐪嬩簡涓涓嬬紪璇戠殑緇撴灉錛?br>鍙戠幇0013FF59 jmp         dwRealProc 鏄竴琛岀殑錛屼篃灝辨槸jmp鍦板潃瀹為檯灝辨槸:
((INT_PTR)this+sizeof(THUNK)) 榪欎釜鍦板潃銆傜粡榪囨祴璇曚篃娌℃湁闂錛屾垜灝辮涓烘槸榪欐牱浜嗭紝涓嶅鐨勮繕
蹇樺鎸囧嚭銆傚樆鍢匯?br>榪樻湁涓涓鏄撴販娣嗙殑錛屽氨鏄垜浠細浼犲叆this鎸囬拡錛屽湪dwRealProc閲岄潰鍜?FlushInstructionCache
閲岄潰閮界敤鍒頒簡this銆傝繖閲岃娉ㄦ剰鍟︼細濡傛灉浣犱笉鐭ラ亾浼犲叆鐨勫弬鏁皌his鎸囬拡鍜屼嬌鐢ㄧ殑榪欎釜this鐨勮瘽錛屼綘灝辮
閲嶆柊澶嶄範涓涓婥++鍩虹浜嗐傝В閲婁竴涓嬶細浼犲叆鐨則his鎸囬拡鍙樹負鍙傛暟pThis錛屼嬌鐢ㄧ殑this鏄疶HUNK鐨則his銆俕_^
*****************************************************************************************/

template<typename dst_type,typename src_type>
dst_type pointer_cast(src_type src)
{
return *static_cast<dst_type*>( static_cast<void*>(&src) );
}

class Test
{
public:
int m_nFirst;
    THUNK m_thunk;
    int      m_nTest;

    //鏋勯犲嚱鏁頒腑鍒濆鍖栦負3錛屼粎涓烘祴璇曪紝浠ヤ究鏌ョ湅澶栭潰鐨勬柟娉旿mpedTest鏄惁鍙互姝g‘鍙栧緱榪欎釜鍊?br>    Test() : m_nTest(3),m_nFirst(4)
    {}

    void TestThunk()
    {
   m_thunk.Init(pointer_cast<int>(&Test::Test2),this);
        FUNC1 f = (FUNC1)&m_thunk;
        f(1,2);
        cout << "Test::TestThunk()" << endl;
    }

int Test2(int a, int b)
{
   cout << a << " " << b << " " << m_nFirst << " " << m_nTest << endl;
   return 0;
}
};

int _tmain(int argc, _TCHAR* argv[])
{
    Test t;
    t.TestThunk();
    system("pause");
    return 0;
}

鎬葷粨錛?/span>

榪欎釜鏄庢樉鏄毚鍔涚殑鍘誨己鍒惰煩杞紝鐩存帴鎶婃寚浠ゅ啓鍏ュ埌鏁版嵁孌典腑錛屽鍔犱簡鍑洪敊鐨勯闄╋紝鑰屼笖鍙Щ妞嶆у彉鐨勫緢宸傛墍浠ュ敖閲忓皯鐢ㄣ?/span>

瑕佸紕娓呮鍑芥暟璋冪敤瑙勫垯鍜屽爢鏍堢殑騫寵 銆傚鏋滀綘鐢?font face="Times New Roman">_cedcl瑙勫垯鐨勫嚱鏁拌皟鐢ㄧ殑璇濓紝灝變細鍑洪敊鍟︺?/font>

瀛︿範浠g爜涓彧鏄鐞嗕簡綆鍗曠殑鎯呭喌錛岃繕鏈夊嚑縐嶆柟寮忥紝渚嬪涓嶆槸寮哄埗璺寵漿錛岃屾槸鐢?font face="Times New Roman">call鐨勬柟寮忚皟鐢紝涔熷彲浠ュ疄鐜般傚浜庡叾浠栫殑鍑芥暟瑙勫垯渚嬪鎴愬憳鍑芥暟鏄?/font>_stdcall錛屼粬鏄弬鏁板帇鏍堢殑錛岃繖涓?/font>THUNK鐨勫啓娉曚篃涓嶄竴鏍蜂簡銆傘?/font>

鍥犱負鏁版嵁孌典腑鐢ㄥ埌浜?font face="Times New Roman">this,鍑芥暟鍥炶皟涓細鐢ㄥ埌瀹冿紝鎵浠ヤ竴瀹氳淇濊瘉榪欎釜this鏈夋晥銆傜壒鍒槸紿楀彛鍥炶皟鍑芥暟錛屽鏋滈噴鏀句簡鍙橀噺錛屼絾鏄獥鍙f病鏈夐攢姣佹槸寰堝鏄撳嚭闂鐨勩傜獥鍙e洖璋冨嚱鏁頒篃鏈夋瘮杈冨枩嬈㈢敤涓涓潤鎬佺殑鍒嗛厤鍣紝閫氳繃紿楀彛璇嗗埆錛屾妸浠栧垎閰嶅埌涓嶅悓鐨勬垚鍛樺鐞嗗嚱鏁頒腑鐨勬柟寮忋?/font>

榪欎釜鍙槸鍒濆錛屽師鍥犳槸鍙戠幇ATL鐨勭獥鍙e洖璋冩槸榪欐牱鍋氱殑銆傝寰楀緢紲炲錛屾墍浠ュ涔犱簡涓涓嬶紝鏈変笉瀵圭殑鍦版柟榪樻湜澶氬鎸囨暀銆傚樆鍢匯傘傘?/font>

鎵懼埌鐨勮祫鏂欙細

http://www.vckbase.com/document/viewdoc/?id=1821

http://www.codeproject.com/KB/cpp/GenericThunks.aspx

http://blog.csdn.net/superarhow/archive/2006/07/10/898261.aspx

http://www.cnblogs.com/homeofish/archive/2009/02/20/1395208.html



shongbee2 2010-12-11 16:14 鍙戣〃璇勮
]]>
璇″紓鐨勫己鍒剁被鍨嬭漿鎹㈡搷浣滅http://m.shnenglu.com/shongbee2/archive/2009/07/28/91524.htmlshongbee2shongbee2Tue, 28 Jul 2009 12:03:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/07/28/91524.htmlhttp://m.shnenglu.com/shongbee2/comments/91524.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/07/28/91524.html#Feedback2http://m.shnenglu.com/shongbee2/comments/commentRss/91524.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/91524.html鏈榪戝湪瀛︿範涓紝鐪嬪埌浜嗕竴孌靛緢璇″紓鐨勪唬鐮併?br>

CComptr<IDispatch> ptrDisp;
IDispatch
* pDisp = ptrDisp;

瀵規寰堟槸鐤戞儜錛屼負浠涔堜袱涓畬鍏ㄤ笉鍚岀殑綾誨瀷鍙互鏃犲樊鍒殑杞崲銆?br>鐚滄祴1錛?br>璁や負IDispatch閲嶈澆浜嗚祴鍊兼搷浣滅銆?.1縐掔殑鏃墮棿鍚﹀畾銆備粬鍙槸涓涓帴鍙o紝瀹氫箟寰堟槑紜殑4鐨勬柟娉曘備笉鍙兘銆傜敱浜庝笉鐩鎬俊錛岃繕鐗規剰鍘葷湅浜嗕竴涓嬩粬鐨勬帴鍙e畾涔夈傚交搴曟蹇冦?br>鐚滄祴2.
CComptr<IDispatch>閲嶈澆浜嗚祴鍊兼搷浣滅銆備絾鏄兂鏉ユ兂鍘誨簲璇ュ拰浠栫殑閲嶈澆娌℃湁鍏崇郴錛屽洜涓鴻繖涓搷浣滃湪浠栫殑宸﹁竟錛屽拰浠栫殑璧嬪兼搷浣滅鍏ㄧ劧娌℃湁鍏崇郴銆備笉淇′箣錛岃繘鍘葷湅浜嗕竴涓嬶紝騫朵笖鎶婇噸杞界粰娉ㄩ噴鎺夛紝緇撴灉榪樻槸鑳界紪璇戞垚鍔燂紝褰誨簳紜俊涓嶆槸璧嬪肩殑浣滅敤銆?br>
鐪熺浉錛?br>緇堜簬鎷垮嚭鏉鎵嬮攺錛孎11錛屽崟姝ワ紝鍝堝搱錛岃繘鍘誨彂鐜板師鏉ユ湁錛?br>

    operator T*() const throw()
    
{
        
return p;
    }

榪欐浠g爜銆傚搱鍝堛傘傞棶浜嗗ぇ鐗涚煡閬撴槸閲嶈澆寮哄埗杞崲銆傚搱鍝堛傜旱嬈茬煡閬撳師鍥犱簡銆傘傘?br>鑷繁涔熸ā浠垮啓浜嗕竴涓嬶細

class A1 
{
public:
    
int operator*()
    
{
        
return 6;
    }

    
operator int() //const
    {
        
return 6;
    }

}
;
int main()
{
    
int a(5);
    
int a1 = int(6);
    A1 aa1;
    
int a2 = aa1;  
    
return 0;
}

緙栬瘧鎴愬姛錛岀埥銆傘傘傘?br>



shongbee2 2009-07-28 20:03 鍙戣〃璇勮
]]>
涓囨伓鐨刲istView鎺т歡http://m.shnenglu.com/shongbee2/archive/2009/07/28/91513.htmlshongbee2shongbee2Tue, 28 Jul 2009 09:28:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/07/28/91513.htmlhttp://m.shnenglu.com/shongbee2/comments/91513.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/07/28/91513.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/91513.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/91513.html鐢ㄨ搗鏉ュ緢涓嶉敊銆傚彲鎯滃搷搴旀秷鎭氨楹葷儲寰堝銆備竴涓彸閿脊鍑鴻彍鍗曪紝灞呯劧寮勭殑瑕佺敤閽╁瓙銆備箣鍚庢墠鍙戠幇鏄秷鎭搷搴旈敊浜嗐傛槸搴旇鍝嶅簲
OnRClick綾諱技鐨勬秷鎭惂(蹇樹簡)錛孡ButtonDown浠涔堢殑灝辮鎯寵幏寰椾簡銆傘傝繕鏈変粈涔圤wnerData浠涔堢殑鍙堟槸涓澶у爢鐨勬秷鎭紝鍝嶅簲鐨勯兘閮侀椃銆傜劧鍚庢垜鐨勭瓥鐣ュ氨鏄洿鎺ョ敤浠栬嚜宸辯殑銆傚搱鍝堛備竴涓秷鎭笉鍝嶅簲銆傘傘傘?br>絳夋湁鏃墮棿浜嗭紝涓瀹氳瀛︿竴涓猯istView鎺т歡鐨勪笓棰樸?C++鐨?銆傘備竴瀹氳鍔姏瀛︿範銆傘傚姞娌廣傘傘?img src ="http://m.shnenglu.com/shongbee2/aggbug/91513.html" width = "1" height = "1" />

shongbee2 2009-07-28 17:28 鍙戣〃璇勮
]]>
銆愯漿銆戝熀浜嶵hunk瀹炵幇鐨勭被鎴愬憳娑堟伅澶勭悊鍑芥暟http://m.shnenglu.com/shongbee2/archive/2009/07/23/90908.htmlshongbee2shongbee2Thu, 23 Jul 2009 03:35:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/07/23/90908.htmlhttp://m.shnenglu.com/shongbee2/comments/90908.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/07/23/90908.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/90908.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/90908.htmlhttp://blog.csdn.net/JerKii/archive/2006/04/07/654188.aspx
鐢變簬姣旇緝澶氾紝鐩存帴璐撮摼鎺ヤ簡銆?br>閮侀椃鐨勬槸鎴戞媧繪病鏈夊紕鎴愬姛銆傘傚攭錛屽彧鏈夌戶緇姞娌瑰挴銆傘傘?img src ="http://m.shnenglu.com/shongbee2/aggbug/90908.html" width = "1" height = "1" />

shongbee2 2009-07-23 11:35 鍙戣〃璇勮
]]>
瀛楃緙栫爜杞崲錛屼負浠涔堟垜鐨処CONV涓嶈兘鐢ㄥ晩錛?/title><link>http://m.shnenglu.com/shongbee2/archive/2009/07/10/89730.html</link><dc:creator>shongbee2</dc:creator><author>shongbee2</author><pubDate>Fri, 10 Jul 2009 07:23:00 GMT</pubDate><guid>http://m.shnenglu.com/shongbee2/archive/2009/07/10/89730.html</guid><wfw:comment>http://m.shnenglu.com/shongbee2/comments/89730.html</wfw:comment><comments>http://m.shnenglu.com/shongbee2/archive/2009/07/10/89730.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/shongbee2/comments/commentRss/89730.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/shongbee2/services/trackbacks/89730.html</trackback:ping><description><![CDATA[<p>鍝庯紝鎵句簡鍗婂ぉ杞崲錛屾壘鍒頒簡ICONV錛屾嵁璇存槸璺ㄥ鉤鍙扮殑錛屽緢鐗涖備笅杞界殑libxml涔熼渶瑕佸埌浠栵紝涔熶笅杞戒簡浠栫殑搴擄紝鐢變簬libxml杞崲緙栫爜鏍煎紡銆?/p> <p>鍙槸鐢ㄦ潵鐢ㄥ幓閮戒笉姝g‘銆傜綉涓婂幓鎵劇殑璧勬枡閮芥槸涓涓増鏈殑錛屾垜鏈鍚庣殑浠g爜涓猴細</p> <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"><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> charToUtf_8(IN </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> strSrc, IN OUT </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">**</span><span style="COLOR: #000000"> pstrDst)<br><img id=Codehighlighter1_63_841_Open_Image onclick="this.style.display='none'; Codehighlighter1_63_841_Open_Text.style.display='none'; Codehighlighter1_63_841_Closed_Image.style.display='inline'; Codehighlighter1_63_841_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_63_841_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_63_841_Closed_Text.style.display='none'; Codehighlighter1_63_841_Open_Image.style.display='inline'; Codehighlighter1_63_841_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_63_841_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_63_841_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">u2g(in_utf8,strlen(in_utf8),out,OUTLEN);</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"> iconv_t cd </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> iconv_open(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">utf-8</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ANSI_X3.4-1986</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">iconv_t cd = iconv_open("utf-8", "CP_ACP");</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (cd </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> (iconv_t)(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">))<br><img id=Codehighlighter1_236_255_Open_Image onclick="this.style.display='none'; Codehighlighter1_236_255_Open_Text.style.display='none'; Codehighlighter1_236_255_Closed_Image.style.display='inline'; Codehighlighter1_236_255_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_236_255_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_236_255_Closed_Text.style.display='none'; Codehighlighter1_236_255_Open_Image.style.display='inline'; Codehighlighter1_236_255_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top> </span><span id=Codehighlighter1_236_255_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_236_255_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>  </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top> }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> size_t ilen </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> ::strlen(strSrc) </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> size_t olen </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> ilen </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">inbuf </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">[ilen];<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">outbuf </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">[olen];<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> memset(inbuf, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, ilen);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> memset(outbuf, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, olen);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>  </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> inbuf;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>  </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> outbuf;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> </span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">  memcpy(inbuf, strSrc, ilen);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> size_t ret </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> iconv(cd, </span><span style="COLOR: #000000">&</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">ilen, </span><span style="COLOR: #000000">&</span><span style="COLOR: #0000ff">out</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">olen);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">涓嬮潰榪欑鏂瑰紡浼氬嚭閿欙紝涓轟粈涔?<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">size_t ret = iconv(cd, &inbuf, &ilen, &outbuf, &olen);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  if (ret == (size_t)(-1))<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  {<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">   cerr << "iconv error" << endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  }<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  else<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  {<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">   cout << outbuf << endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">  }</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> delete[] inbuf;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> delete outbuf;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> iconv_close(cd);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <p> </p> <p>褰撶劧榪欎簺浠g爜鏄粠緗戜笂鎷瘋礉涓嬫潵鍐嶆敼鐨勩傜紪璇戦氳繃錛岃繍琛屽氨涓嶈浜嗐?/p> <p>鍚庢潵鎴戞斁寮冧簡銆傜洿鎺ョ敤windows鐨勬柟娉曘傦紙榪樺ソ鎴戞槸鍦╳indows涓婂紑鍙戯級</p> <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"><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> CharToUtf_8(IN </span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> strSrc, IN OUT </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">**</span><span style="COLOR: #000000"> pstrDst)<br><img id=Codehighlighter1_63_459_Open_Image onclick="this.style.display='none'; Codehighlighter1_63_459_Open_Text.style.display='none'; Codehighlighter1_63_459_Closed_Image.style.display='inline'; Codehighlighter1_63_459_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_63_459_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_63_459_Closed_Text.style.display='none'; Codehighlighter1_63_459_Open_Image.style.display='inline'; Codehighlighter1_63_459_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_63_459_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_63_459_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> assert(pstrDst);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> nSize </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> MultiByteToWideChar(CP_ACP,NULL, strSrc, </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, NULL, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> WCHAR</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pwchTemp </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> WCHAR[nSize];<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> nSize </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> MultiByteToWideChar(CP_ACP,NULL, strSrc, </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, pwchTemp, nSize);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> nSize </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> WideCharToMultiByte(CP_UTF8, NULL, pwchTemp, </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, NULL, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">pstrDst </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">[nSize];<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> nSize </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> WideCharToMultiByte(CP_UTF8, NULL, pwchTemp, </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">pstrDst, nSize, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top> </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div> <p> </p> <p>榪欐牱灝卞彲浠ラタ浜嗐傚懙鍛點傘傚搸銆傘傘傘?br>涓嶈繃鎸洪儊闂風殑錛屼負浠涔圛CONV涓嶈兘鐢ㄥ晩錛屾湁楂樻墜鎸囩偣涓涓嬪悧錛?/p><img src ="http://m.shnenglu.com/shongbee2/aggbug/89730.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/shongbee2/" target="_blank">shongbee2</a> 2009-07-10 15:23 <a href="http://m.shnenglu.com/shongbee2/archive/2009/07/10/89730.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VS2008璁劇疆鍐呭瓨鏂偣http://m.shnenglu.com/shongbee2/archive/2009/07/08/89571.htmlshongbee2shongbee2Wed, 08 Jul 2009 13:55:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/07/08/89571.htmlhttp://m.shnenglu.com/shongbee2/comments/89571.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/07/08/89571.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/89571.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/89571.html鑿滈笩鐨勬垜灞呯劧涓嶇煡閬撲粈涔堟槸鍐呭瓨鏂偣銆?br>鑷繁鐞嗚В涓涓嬶細鍐呭瓨鏂偣灝辨槸褰撴煇涓唴瀛樻敼鍙樼殑鏃跺欎細鏂笅鏉ョ殑銆傚氨璺熺▼搴忔柇鐐逛竴鏍鳳紝榪愯鍒伴偅閲屽氨鏂笅鏉ヤ竴鏍楓?br>VS2008鎬庝箞璁劇疆鍐呭瓨鏂偣鍛€傛垜鎵撳紑鍐呭瓨鐩戣鍣ㄣ傛寜F9鏄病鏈夋晥鏋滅殑錛岀粰鍑洪敊璇彁紺恒傚悗鏉ラ氳繃緗戜笂鎼滀簡鎵嶇煡閬撳師鏉ユ槸榪欐牱璁劇疆鐨勫摝錛佸搱鍝堛?br>鎴浘浠涔堢殑灝辯畻浜嗭紝鍥犱負鎴戣寰楁垜瀵筕S2008鐨勭晫闈㈠簲璇ヨ繕鏄瘮杈冧簡瑙g殑鍚с傚搱鍝?br>
1.鍐呭瓨鏂偣鍙兘鏄湪紼嬪簭璋冭瘯榪愯鐨勬椂鍊欐墠鑳借緗殑銆傝繖璺熸櫘閫氱殑浠g爜鏂偣涓嶄竴鏍楓?br>2.榪涘叆璋冭瘯鐘舵侊紝錛堟寜F5鍟︼級錛岃緗竴涓鐩戞帶鐨勫唴瀛樼殑鍙橀噺鍝噷璁劇疆鏂偣鍏堟柇涓嬫潵銆傦紙鎴戞槸榪欐牱鍋氱殑錛夈?br>3.鏂笅鏉ヤ箣鍚庯紝鍝堝搱錛屽叧閿細鐐瑰嚮鑿滃崟鏍忕殑Debug->new Breakpoint-> new DataBreakPoint銆傝繖灝辨槸璁劇疆鍐呭瓨鐨勬柇鐐瑰暒銆?br>4 銆傜偣鍑諱箣鍚庝細鍑烘潵涓涓緗唴瀛樻柇鐐圭殑瀵硅瘽妗嗭紝濉ソ濂芥柇鐨勫唴瀛樺氨鍙互浜嗐備笂闈㈢殑鍦板潃鏄彲浠ョ洿鎺ョ敤鍙橀噺鍚嶅姞鍙栧湴鍧絎︾殑銆備緥濡?amp;a錛屽叾浠栫殑搴旇灝卞ソ鐞嗚В錛岀洃鎺х殑闀垮害鍜岃璦銆傝緗氨OK浜嗭紝鍝堝搱銆?br>浠婂ぉ鏈夊浜嗕竴鎷涳紝浠ュ悗濡傛灉鎯崇煡閬撳唴瀛樹粈涔堟椂鍊欒鏀瑰彉錛屼亢灝變笉鎬曞暒銆傘傘?/p>

shongbee2 2009-07-08 21:55 鍙戣〃璇勮
]]>
gtest瀛︿範鏂囩珷http://m.shnenglu.com/shongbee2/archive/2009/07/08/89531.htmlshongbee2shongbee2Wed, 08 Jul 2009 02:28:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/07/08/89531.htmlhttp://m.shnenglu.com/shongbee2/comments/89531.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/07/08/89531.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/89531.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/89531.html鐜板湪瑕佺敤gtest妗嗘灦鍐欏崟鍏冩祴璇曘傛墍浠ョ綉涓婃壘浜嗕竴涓涔犺祫鏂欙紙鎴栨槸鏁欑▼錛夊懙鍛碉紝鍥犱負鎴戠殑鍩虹寰堢儌錛岀洿鎺ョ湅瀹樻柟鐨勬枃妗e彲鑳戒笉鏄緢浼氥傝阿璋㈡彁渚涜呫?br>鏂囩珷鍦板潃錛?a >http://www.cnblogs.com/coderzh/archive/2009/04/06/1426758.html
榪欐槸涓涓郴鍒楃殑錛屽笇鏈涙棭鏃ョ湅瀹屻傚搱鍝堬紝鍔犳補銆傘傘?/p>

shongbee2 2009-07-08 10:28 鍙戣〃璇勮
]]>
STL_Map鐨勭畝鍗曞疄鐢?/title><link>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79029.html</link><dc:creator>shongbee2</dc:creator><author>shongbee2</author><pubDate>Sun, 05 Apr 2009 10:11:00 GMT</pubDate><guid>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79029.html</guid><wfw:comment>http://m.shnenglu.com/shongbee2/comments/79029.html</wfw:comment><comments>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79029.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/shongbee2/comments/commentRss/79029.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/shongbee2/services/trackbacks/79029.html</trackback:ping><description><![CDATA[浠婂ぉ瀛︿簡STL涓璏ap鐨勭畝鍗曟搷浣滐紝瀛︾殑寰堣偆嫻咃紝鍛靛懙錛岀洰鍓嶆垜鍙敤鍒拌繖浜涳紝榪橀渶瑕佺戶緇姫鍔涖傚懙鍛點傚鏋滆鏌ラ槄MSDN鐨勮瘽錛屽叧閿瓧鍙互鐢╩ap class.鍛靛懙銆傝繕鏈夊鐪嬩竴涓嬪叾瀹冧粙緇峉TL鐨勪功銆備篃鍒氬垰杞澆浜嗗崥瀹㈠洯涓涓墠杈堢殑map璧勬枡錛屽緢涓嶉敊銆傛墍浠ヨ繖閲屽氨鐩存帴濂変笂婧愪唬鐮侊細娉ㄦ剰[]鐨勬搷浣滐紝浠栨槸涓涓彃鍏ュ拰淇敼錛屾煡鎵懼悎騫剁殑榪囩▼錛屽鏋滄病鏈夋壘鍒幫紝浠栦細鎻掑叆涓涓粯璁ゅ厓绱犵殑銆傚鏋滆淇敼錛屽彲浠ョ洿鎺ョ敤[]鍋氫慨鏀廣傚懙鍛點?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"><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><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><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">map</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_68_1330_Open_Image onclick="this.style.display='none'; Codehighlighter1_68_1330_Open_Text.style.display='none'; Codehighlighter1_68_1330_Closed_Image.style.display='inline'; Codehighlighter1_68_1330_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_68_1330_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_68_1330_Closed_Text.style.display='none'; Codehighlighter1_68_1330_Open_Image.style.display='inline'; Codehighlighter1_68_1330_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_68_1330_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_68_1330_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    typedef map</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">, </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> Map_DInt;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    typedef pair</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">, </span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> Map_Pair;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    Map_DInt map1;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">empty鏄嫻媘ap鏄惁涓虹┖</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (map1.empty())        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">媯嫻嬫槸鍚︿負絀哄鏋滀負絀猴紝杈撳嚭</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_211_236_Open_Image onclick="this.style.display='none'; Codehighlighter1_211_236_Open_Text.style.display='none'; Codehighlighter1_211_236_Closed_Image.style.display='inline'; Codehighlighter1_211_236_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_211_236_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_211_236_Closed_Text.style.display='none'; Codehighlighter1_211_236_Open_Image.style.display='inline'; Codehighlighter1_211_236_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_211_236_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_211_236_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">empty\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    map1[</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">] </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">30</span><span style="COLOR: #000000">;        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍥犱負map閲嶈澆浜哰]鍙互閫氳繃[]鐩存帴娣誨姞鏁版嵁鍜屾煡鎵炬暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    map1.insert(Map_DInt::value_type(</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">));    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">娣誨姞鏁版嵁4(key), 40(value)</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    map1.insert(Map_Pair(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">));        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">娣誨姞鏁版嵁1,10<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">閬嶅巻鑺傜偣錛屽茍杈撳嚭瀵瑰簲鐨刱ey鍜寁alue</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (Map_DInt::iterator it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map1.begin(); it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> map1.end(); </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">it1)<br><img id=Codehighlighter1_491_560_Open_Image onclick="this.style.display='none'; Codehighlighter1_491_560_Open_Text.style.display='none'; Codehighlighter1_491_560_Closed_Image.style.display='inline'; Codehighlighter1_491_560_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_491_560_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_491_560_Closed_Text.style.display='none'; Codehighlighter1_491_560_Open_Image.style.display='inline'; Codehighlighter1_491_560_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_491_560_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_491_560_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Key:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> it1</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">first </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> Value:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">it1</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">second </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">[]涔熷彲浠ョ洿鎺ョ敤浜庢煡鎵撅紝浣嗘槸濡傛灉娌℃湁鎵懼埌錛屼粬浼氶粯璁ゅ姞涓涓艱繘鍘葷殑</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    Map_DInt::iterator it1;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map1.find(</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘key 涓?鐨勬暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> map1.end())    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鎵懼埌錛屽垯杈撳嚭浠栫殑鏁版嵁</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_701_735_Open_Image onclick="this.style.display='none'; Codehighlighter1_701_735_Open_Text.style.display='none'; Codehighlighter1_701_735_Closed_Image.style.display='inline'; Codehighlighter1_701_735_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_701_735_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_701_735_Closed_Text.style.display='none'; Codehighlighter1_701_735_Open_Image.style.display='inline'; Codehighlighter1_701_735_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_701_735_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_701_735_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> it1</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">second </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">                    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍚﹀垯杈撳嚭鎵句笉鍒?/span><span style="COLOR: #008000"><br><img id=Codehighlighter1_758_787_Open_Image onclick="this.style.display='none'; Codehighlighter1_758_787_Open_Text.style.display='none'; Codehighlighter1_758_787_Closed_Image.style.display='inline'; Codehighlighter1_758_787_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_758_787_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_758_787_Closed_Text.style.display='none'; Codehighlighter1_758_787_Open_Image.style.display='inline'; Codehighlighter1_758_787_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_758_787_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_758_787_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Not Found\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (map1[</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">0</span><span style="COLOR: #000000">)<br><img id=Codehighlighter1_810_840_Open_Image onclick="this.style.display='none'; Codehighlighter1_810_840_Open_Text.style.display='none'; Codehighlighter1_810_840_Closed_Image.style.display='inline'; Codehighlighter1_810_840_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_810_840_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_810_840_Closed_Text.style.display='none'; Codehighlighter1_810_840_Open_Image.style.display='inline'; Codehighlighter1_810_840_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_810_840_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_810_840_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> map1[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">] </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_849_878_Open_Image onclick="this.style.display='none'; Codehighlighter1_849_878_Open_Text.style.display='none'; Codehighlighter1_849_878_Closed_Image.style.display='inline'; Codehighlighter1_849_878_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_849_878_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_849_878_Closed_Text.style.display='none'; Codehighlighter1_849_878_Open_Image.style.display='inline'; Codehighlighter1_849_878_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_849_878_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_849_878_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Not Found\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map1.find(</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘key 涓?鐨勬暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> map1.end())    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鎵懼埌錛屽垯杈撳嚭浠栫殑鏁版嵁</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_957_991_Open_Image onclick="this.style.display='none'; Codehighlighter1_957_991_Open_Text.style.display='none'; Codehighlighter1_957_991_Closed_Image.style.display='inline'; Codehighlighter1_957_991_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_957_991_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_957_991_Closed_Text.style.display='none'; Codehighlighter1_957_991_Open_Image.style.display='inline'; Codehighlighter1_957_991_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_957_991_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_957_991_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> it1</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">second </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">                    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍚﹀垯杈撳嚭鎵句笉鍒?/span><span style="COLOR: #008000"><br><img id=Codehighlighter1_1014_1043_Open_Image onclick="this.style.display='none'; Codehighlighter1_1014_1043_Open_Text.style.display='none'; Codehighlighter1_1014_1043_Closed_Image.style.display='inline'; Codehighlighter1_1014_1043_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1014_1043_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1014_1043_Closed_Text.style.display='none'; Codehighlighter1_1014_1043_Open_Image.style.display='inline'; Codehighlighter1_1014_1043_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_1014_1043_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1014_1043_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Not Found\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    map1[</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">50</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏇存敼鐩稿簲鐨勫?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map1.find(</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘key 涓?鐨勬暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> map1.end())    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鎵懼埌錛屽垯杈撳嚭浠栫殑鏁版嵁</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_1148_1182_Open_Image onclick="this.style.display='none'; Codehighlighter1_1148_1182_Open_Text.style.display='none'; Codehighlighter1_1148_1182_Closed_Image.style.display='inline'; Codehighlighter1_1148_1182_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1148_1182_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1148_1182_Closed_Text.style.display='none'; Codehighlighter1_1148_1182_Open_Image.style.display='inline'; Codehighlighter1_1148_1182_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_1148_1182_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1148_1182_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> it1</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">second </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">                    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍚﹀垯杈撳嚭鎵句笉鍒?/span><span style="COLOR: #008000"><br><img id=Codehighlighter1_1205_1234_Open_Image onclick="this.style.display='none'; Codehighlighter1_1205_1234_Open_Text.style.display='none'; Codehighlighter1_1205_1234_Closed_Image.style.display='inline'; Codehighlighter1_1205_1234_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1205_1234_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1205_1234_Closed_Text.style.display='none'; Codehighlighter1_1205_1234_Open_Image.style.display='inline'; Codehighlighter1_1205_1234_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_1205_1234_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_1205_1234_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Not Found\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    size_t nNum </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> map1.erase(</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒犻櫎鏁版嵁</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    map1.clear();        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">娓呮鎵鏈夋暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    system(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">pause</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://m.shnenglu.com/shongbee2/aggbug/79029.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/shongbee2/" target="_blank">shongbee2</a> 2009-04-05 18:11 <a href="http://m.shnenglu.com/shongbee2/archive/2009/04/05/79029.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>銆愯漿銆慡TL map甯哥敤鎿嶄綔綆浠?/title><link>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79026.html</link><dc:creator>shongbee2</dc:creator><author>shongbee2</author><pubDate>Sun, 05 Apr 2009 09:48:00 GMT</pubDate><guid>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79026.html</guid><wfw:comment>http://m.shnenglu.com/shongbee2/comments/79026.html</wfw:comment><comments>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79026.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/shongbee2/comments/commentRss/79026.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/shongbee2/services/trackbacks/79026.html</trackback:ping><description><![CDATA[<p>杞嚜錛?a >http://www.cnblogs.com/TianFang/archive/2006/12/30/607859.html</a><strong><br>1銆傜洰褰?</strong></p> <ol> <li>map綆浠? <li>map鐨勫姛鑳? <li>浣跨敤map <li>鍦╩ap涓彃鍏ュ厓绱? <li>鏌ユ壘騫惰幏鍙杕ap涓殑鍏冪礌 <li>浠巑ap涓垹闄ゅ厓绱?</li> </ol> <p><strong>2銆俶ap綆浠?</strong></p> <p>map鏄竴綾?span style="COLOR: red">鍏寵仈寮忓鍣?/span>銆傚畠鐨勭壒鐐規槸<span style="COLOR: #9bbb59">澧炲姞鍜屽垹闄よ妭鐐瑰榪唬鍣ㄧ殑褰卞搷寰堝皬</span>錛岄櫎浜嗛偅涓搷浣滆妭鐐癸紝瀵瑰叾浠栫殑鑺傜偣閮芥病鏈変粈涔堝獎鍝嶃傚浜庤凱浠e櫒鏉ヨ錛屽彲浠ヤ慨鏀瑰疄鍊鹼紝鑰屼笉鑳戒慨鏀筴ey銆?</p> <p><strong>3銆俶ap鐨勫姛鑳?</strong></p> <ol> <li>鑷姩寤虹珛Key 錛?value鐨勫搴斻俴ey 鍜?value鍙互鏄換鎰忎綘闇瑕佺殑綾誨瀷銆? <li>鏍規嵁key鍊煎揩閫熸煡鎵捐褰曪紝鏌ユ壘鐨勫鏉傚害鍩烘湰鏄疞og(N)錛屽鏋滄湁1000涓褰曪紝鏈澶氭煡鎵?0嬈★紝1,000,000涓褰曪紝鏈澶氭煡鎵?0嬈°? <li>蹇熸彃鍏ey - Value 璁板綍銆? <li>蹇熷垹闄よ褰? <li>鏍規嵁Key 淇敼value璁板綍銆? <li>閬嶅巻鎵鏈夎褰曘?</li> </ol> <p><strong>4銆備嬌鐢╩ap </strong></p> <p>浣跨敤map寰楀寘鍚玬ap綾繪墍鍦ㄧ殑澶存枃浠?br>#include <map> //娉ㄦ剰錛孲TL澶存枃浠舵病鏈夋墿灞曞悕.h </p> <p>map瀵硅薄鏄ā鏉跨被錛岄渶瑕佸叧閿瓧鍜屽瓨鍌ㄥ璞′袱涓ā鏉垮弬鏁幫細<br>std:map<int, string> personnel;<br>榪欐牱灝卞畾涔変簡涓涓敤int浣滀負绱㈠紩,騫舵嫢鏈夌浉鍏寵仈鐨勬寚鍚憇tring鐨勬寚閽? </p> <p>涓轟簡浣跨敤鏂逛究錛屽彲浠ュ妯℃澘綾昏繘琛屼竴涓嬬被鍨嬪畾涔夛紝 </p> <p style="MARGIN-LEFT: 11pt">typedef map<int, CString> UDT_MAP_INT_CSTRING; <br>UDT_MAP_INT_CSTRING enumMap; </p> <p><strong>5銆傚湪map涓彃鍏ュ厓绱?</strong></p> <p>鏀瑰彉map涓殑鏉$洰闈炲父綆鍗曪紝鍥犱負map綾誨凡緇忓[]鎿嶄綔絎﹁繘琛屼簡閲嶈澆 </p> <p style="MARGIN-LEFT: 11pt">enumMap[1] = "One";<br>enumMap[2] = "Two";<br>..... </p> <p>榪欐牱闈炲父鐩磋錛屼絾瀛樺湪涓涓ц兘鐨勯棶棰樸?span style="COLOR: #9bbb59">鎻掑叆2鏃?鍏堝湪enumMap涓煡鎵句富閿負2鐨勯」錛屾病鍙戠幇錛岀劧鍚庡皢涓涓柊鐨勫璞℃彃鍏numMap錛岄敭鏄?錛屽兼槸涓涓┖瀛楃涓詫紝鎻掑叆瀹屾垚鍚庯紝灝嗗瓧絎︿覆璧嬩負"Two"</span>; 璇ユ柟娉曚細灝嗘瘡涓奸兘璧嬩負緙虹渷鍊鹼紝鐒跺悗鍐嶈祴涓烘樉紺虹殑鍊鹼紝濡傛灉鍏冪礌鏄被瀵硅薄錛屽垯寮閿姣旇緝澶с傛垜浠彲浠ョ敤浠ヤ笅鏂規硶鏉ラ伩鍏嶅紑閿錛?</p> <p style="MARGIN-LEFT: 11pt">enumMap.<span style="COLOR: #f79646">insert</span>(map<int, CString> :: value_type(2, "Two")) </p> <p><strong>6銆傛煡鎵懼茍鑾峰彇map涓殑鍏冪礌 </strong></p> <p>涓嬫爣鎿嶄綔絎︾粰鍑轟簡鑾峰緱涓涓肩殑鏈綆鍗曟柟娉曪細 </p> <p style="MARGIN-LEFT: 11pt">CString tmp = enumMap[2]; </p> <p>浣嗘槸,<span style="COLOR: #948a54">鍙湁褰搈ap涓湁榪欎釜閿殑瀹炰緥鏃舵墠瀵?/span>錛屽惁鍒欎細鑷姩鎻?span style="COLOR: #548dd4">鍏ヤ竴涓疄渚嬶紝鍊間負鍒濆鍖栧?/span>銆?</p> <p>鎴戜滑鍙互浣跨敤Find()鍜孋ount()鏂規硶鏉ュ彂鐜頒竴涓敭鏄惁瀛樺湪銆?</p> <p>鏌ユ壘map涓槸鍚﹀寘鍚煇涓叧閿瓧鏉$洰鐢?span style="COLOR: #f79646">find()</span>鏂規硶錛屼紶鍏ョ殑鍙傛暟鏄鏌ユ壘鐨刱ey錛屽湪榪欓噷闇瑕佹彁鍒扮殑鏄痓egin()鍜宔nd()涓や釜鎴愬憳錛屽垎鍒唬琛╩ap瀵硅薄涓涓涓潯鐩拰鏈鍚庝竴涓潯鐩紝榪欎袱涓暟鎹殑綾誨瀷鏄痠terator. </p> <p style="MARGIN-LEFT: 11pt">int nFindKey = 2;            //瑕佹煡鎵劇殑Key<br>//瀹氫箟涓涓潯鐩彉閲?瀹為檯鏄寚閽?<br>UDT_MAP_INT_CSTRING::iterator it= enumMap.find(nFindKey); <br>if(it == enumMap.end()) {<br>    //娌℃壘鍒?br>}<br>else {<br>    //鎵懼埌<br>} </p> <p>閫氳繃map瀵硅薄鐨勬柟娉曡幏鍙栫殑iterator鏁版嵁綾誨瀷鏄竴涓猻td::pair瀵硅薄錛屽寘鎷袱涓暟鎹?iterator->first 鍜?iterator->second 鍒嗗埆浠h〃鍏抽敭瀛楀拰瀛樺偍鐨勬暟鎹?</p> <p><strong>7銆備粠map涓垹闄ゅ厓绱?</strong></p> <p>縐婚櫎鏌愪釜map涓煇涓潯鐩敤<span style="COLOR: #f79646">erase()</span> </p> <p>璇ユ垚鍛樻柟娉曠殑瀹氫箟濡備笅 </p> <ol> <li>iterator erase(iterator it); //閫氳繃涓涓潯鐩璞″垹闄? <li>iterator erase(iterator first, iterator last);        //鍒犻櫎涓涓寖鍥? <li>size_type erase(const Key& key); //閫氳繃鍏抽敭瀛楀垹闄?</li> </ol> <p><span style="COLOR: #f79646">clear()</span>灝辯浉褰撲簬 enumMap.erase(enumMap.begin(), enumMap.end()); </p> <img src ="http://m.shnenglu.com/shongbee2/aggbug/79026.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/shongbee2/" target="_blank">shongbee2</a> 2009-04-05 17:48 <a href="http://m.shnenglu.com/shongbee2/archive/2009/04/05/79026.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>STL涓璼et鐨勭畝鍗曞涔?/title><link>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79011.html</link><dc:creator>shongbee2</dc:creator><author>shongbee2</author><pubDate>Sun, 05 Apr 2009 06:58:00 GMT</pubDate><guid>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79011.html</guid><wfw:comment>http://m.shnenglu.com/shongbee2/comments/79011.html</wfw:comment><comments>http://m.shnenglu.com/shongbee2/archive/2009/04/05/79011.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.shnenglu.com/shongbee2/comments/commentRss/79011.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/shongbee2/services/trackbacks/79011.html</trackback:ping><description><![CDATA[浠婂ぉ鎴戝涔犱簡STL涓璼et鐨勭畝鍗曠敤娉曪紝set鍜宮ap涓鏍鋒槸涓涓敤騫寵 浜屽弶鏍戝啓鐨勬ā鏉匡紝map鍙互鏈変袱涓垨澶氳繖涓彧閰嶅錛岃宻et鍙湁涓涓紝褰撲綘鍙瓨鏀句竴涓厓绱犵殑鏃跺欙紝鍙互鑰冭檻鐢╯et,浠栫殑鏈夌偣鍜宮ap涓鏍鳳紝鏌ユ壘寰堝揩銆傚懙鍛點傚洜涓烘垜鍙敤鍒皊et鐨勪竴浜涚畝鍗曠殑鍔熻兘錛屾墍浠ヤ篃鍙浜嗕竴鐐圭偣浠栫殑鐢ㄦ硶銆傛洿娣卞叆鐨勭敤娉曡繕蹇呴』緇х畫鍔犳補瀛︿範銆傚懙鍛點傚浜嗭紝濡傛灉瑕佹煡MSDN涓叧浜巗et鐨勭敤娉曠殑璇濓紝鍏抽敭瀛楃敤set class灝卞彲浠ヤ簡銆傚彧鐢╯et璨屼技榪樿鎵懼崐澶┿傝櫧鐒剁畝鍗曪紝榪樻槸鎶婃簮浠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"><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><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><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>#include</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">set</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000"> std;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_68_915_Open_Image onclick="this.style.display='none'; Codehighlighter1_68_915_Open_Text.style.display='none'; Codehighlighter1_68_915_Closed_Image.style.display='inline'; Codehighlighter1_68_915_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_68_915_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_68_915_Closed_Text.style.display='none'; Codehighlighter1_68_915_Open_Image.style.display='inline'; Codehighlighter1_68_915_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_68_915_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_68_915_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">set</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> st1;                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒涘緩涓涓猧nt綾誨瀷鐨剆et</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">set</span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::iterator it1;        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒涘緩涓涓粬瀵瑰簲鐨勮凱浠e櫒<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">empty鏄垽鏂粬鏄惁涓虹┖錛岃屼笖濡傛灉瑕佸垽鏂┖錛屾渶濂界敤榪欎釜鏉ュ垽鏂?br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉涓虹┖榪斿洖true</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (st1.empty())            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒ゆ柇絀?濡傛灉鏄┖錛屽垯杈撳嚭empty</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_235_260_Open_Image onclick="this.style.display='none'; Codehighlighter1_235_260_Open_Text.style.display='none'; Codehighlighter1_235_260_Closed_Image.style.display='inline'; Codehighlighter1_235_260_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_235_260_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_235_260_Closed_Text.style.display='none'; Codehighlighter1_235_260_Open_Image.style.display='inline'; Codehighlighter1_235_260_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_235_260_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_235_260_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">empty\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘鏁版嵁錛宖ind銆傝繑鍥炲兼槸鎵懼埌鐨勬儏鍐電殑榪唬鍣紝濡傛灉娌℃湁鎵懼埌錛?br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">榪唬鍣ㄥ彧鎯砮nd錛屽鏋滄壘鍒幫紝涓烘壘鍒扮殑鏁版嵁錛屾墍浠ヨ繖閲屼竴瀹氳鍏?br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒ゆ柇涓涓嬫槸鍚︽壘鍒版暟鎹簡銆?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> st1.find(</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">);            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘鏁版嵁</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> st1.end())        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鎵懼埌灝辮緭鍑烘暟鎹?/span><span style="COLOR: #008000"><br><img id=Codehighlighter1_414_442_Open_Image onclick="this.style.display='none'; Codehighlighter1_414_442_Open_Text.style.display='none'; Codehighlighter1_414_442_Closed_Image.style.display='inline'; Codehighlighter1_414_442_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_414_442_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_414_442_Closed_Text.style.display='none'; Codehighlighter1_414_442_Open_Image.style.display='inline'; Codehighlighter1_414_442_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_414_442_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_414_442_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">it1 </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎻掑叆鏁版嵁銆?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    st1.insert(</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">);                </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鎻掑叆鏁版嵁</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    st1.insert(</span><span style="COLOR: #000000">30</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    st1.insert(</span><span style="COLOR: #000000">20</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    st1.insert(</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">);                <br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">閬嶅巻鏁版嵁錛岀敤榪唬鍣ㄩ亶鍘嗘暟鎹?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> st1.begin(); it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> st1.end(); </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">it1)    <br><img id=Codehighlighter1_607_634_Open_Image onclick="this.style.display='none'; Codehighlighter1_607_634_Open_Text.style.display='none'; Codehighlighter1_607_634_Closed_Image.style.display='inline'; Codehighlighter1_607_634_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_607_634_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_607_634_Closed_Text.style.display='none'; Codehighlighter1_607_634_Open_Image.style.display='inline'; Codehighlighter1_607_634_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </span><span id=Codehighlighter1_607_634_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_607_634_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">it1 </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    <br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍥犱負寮濮嬫病鏈?0榪欎釜鍏冪礌錛屾墍浠ユ壘涓嶅埌錛岀幇鍦ㄦ彃鍏ヤ簡錛屽啀<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">瀵繪壘涓涓嬨傚懙鍛碉紝鎵懼埌浜嗐?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    it1 </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> st1.find(</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">);            </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鏌ユ壘鏁版嵁</span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (it1 </span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000"> st1.end())        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">濡傛灉鎵懼埌灝辮緭鍑烘暟鎹?/span><span style="COLOR: #008000"><br><img id=Codehighlighter1_751_779_Open_Image onclick="this.style.display='none'; Codehighlighter1_751_779_Open_Text.style.display='none'; Codehighlighter1_751_779_Closed_Image.style.display='inline'; Codehighlighter1_751_779_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_751_779_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_751_779_Closed_Text.style.display='none'; Codehighlighter1_751_779_Open_Image.style.display='inline'; Codehighlighter1_751_779_Open_Text.style.display='inline';" src="http://m.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">    </span><span id=Codehighlighter1_751_779_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://m.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_751_779_Open_Text><span style="COLOR: #000000">{<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>        cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">  </span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">it1 </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">鍒犻櫎鏁版嵁榪欓噷榪斿洖鐨勬槸鍒犻櫎鐨勪釜鏁般傚湪榪欓噷褰撶劧鏄?鍜?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    size_t kk </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> st1.erase(</span><span style="COLOR: #000000">40</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    cout </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> kk </span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000"> endl;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">娓呴櫎鍏ㄩ儴鏁版嵁銆?/span><span style="COLOR: #008000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">    st1.clear();<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    system(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">pause</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://m.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://m.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span></div> <img src ="http://m.shnenglu.com/shongbee2/aggbug/79011.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/shongbee2/" target="_blank">shongbee2</a> 2009-04-05 14:58 <a href="http://m.shnenglu.com/shongbee2/archive/2009/04/05/79011.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>銆愯漿銆戝嚱鏁拌皟鐢ㄧ殑涓浜涚害瀹歘_cdecl __fastcall涓?__stdcallhttp://m.shnenglu.com/shongbee2/archive/2009/04/02/78672.htmlshongbee2shongbee2Thu, 02 Apr 2009 04:52:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/04/02/78672.htmlhttp://m.shnenglu.com/shongbee2/comments/78672.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/04/02/78672.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/78672.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/78672.html__cdecl __fastcall涓?__stdcall

璋冪敤綰﹀畾錛?
__cdecl __fastcall涓?__stdcall錛屼笁鑰呴兘鏄皟鐢ㄧ害瀹?Calling convention)錛屽畠鍐沖畾浠ヤ笅鍐呭錛?)鍑芥暟鍙傛暟鐨勫帇鏍堥『搴忥紝2)鐢辮皟鐢ㄨ呰繕鏄璋冪敤鑰呮妸鍙傛暟寮瑰嚭鏍堬紝3)浠ュ強浜х敓鍑芥暟淇グ鍚嶇殑鏂規硶銆?

1銆乢_stdcall璋冪敤綰﹀畾錛氬嚱鏁扮殑鍙傛暟鑷彸鍚戝乏閫氳繃鏍堜紶閫掞紝琚皟鐢ㄧ殑鍑芥暟鍦ㄨ繑鍥炲墠娓呯悊浼犻佸弬鏁扮殑鍐呭瓨鏍堬紝

2銆乢cdecl鏄疌鍜孋錛嬶紜紼嬪簭鐨勭己鐪佽皟鐢ㄦ柟寮忋傛瘡涓涓皟鐢ㄥ畠鐨勫嚱鏁伴兘鍖呭惈娓呯┖鍫嗘爤鐨勪唬鐮侊紝鎵浠ヤ駭鐢熺殑鍙墽琛屾枃浠跺ぇ灝忎細姣旇皟鐢╛stdcall鍑芥暟鐨勫ぇ銆傚嚱鏁伴噰鐢ㄤ粠鍙沖埌宸︾殑鍘嬫爤鏂瑰紡銆傛敞鎰忥細瀵逛簬鍙彉鍙傛暟鐨勬垚鍛樺嚱鏁幫紝濮嬬粓浣跨敤__cdecl鐨勮漿鎹㈡柟寮忋?

3銆乢_fastcall璋冪敤綰﹀畾錛氬畠鏄氳繃瀵勫瓨鍣ㄦ潵浼犻佸弬鏁扮殑錛堝疄闄呬笂錛屽畠鐢‥CX鍜孍DX浼犻佸墠涓や釜鍙屽瓧錛圖WORD錛夋垨鏇村皬鐨勫弬鏁幫紝鍓╀笅鐨勫弬鏁頒粛鏃ц嚜鍙沖悜宸﹀帇鏍堜紶閫侊紝琚皟鐢ㄧ殑鍑芥暟鍦ㄨ繑鍥炲墠娓呯悊浼犻佸弬鏁扮殑鍐呭瓨鏍堬級銆?

4銆乼hiscall浠呬粎搴旂敤浜?C++"鎴愬憳鍑芥暟銆倀his鎸囬拡瀛樻斁浜嶤X瀵勫瓨鍣紝鍙傛暟浠庡彸鍒板乏鍘嬨倀hiscall涓嶆槸鍏抽敭璇嶏紝鍥犳涓嶈兘琚▼搴忓憳鎸囧畾銆?

5銆? naked call閲囩敤1-4鐨勮皟鐢ㄧ害瀹氭椂錛屽鏋滃繀瑕佺殑璇濓紝榪涘叆鍑芥暟鏃剁紪璇戝櫒浼氫駭鐢熶唬鐮佹潵淇濆瓨ESI錛孍DI錛孍BX錛孍BP瀵勫瓨鍣紝閫鍑哄嚱鏁版椂鍒欎駭鐢熶唬鐮佹仮澶嶈繖浜? 瀵勫瓨鍣ㄧ殑鍐呭銆俷aked call涓嶄駭鐢熻繖鏍風殑浠g爜銆俷aked call涓嶆槸綾誨瀷淇グ絎︼紝鏁呭繀欏誨拰_declspec鍏卞悓浣跨敤銆?

璋冪敤綰﹀畾鍙互閫氳繃宸ョ▼璁劇疆錛歋etting...\C/C++ \Code Generation欏硅繘琛岄夋嫨錛岀己鐪佺姸鎬佷負__cdecl銆?

鍚嶅瓧淇グ綰﹀畾錛?

1銆佷慨楗板悕(Decoration name)錛?C"鎴栬?C++"鍑芥暟鍦ㄥ唴閮紙緙栬瘧鍜岄摼鎺ワ級閫氳繃淇グ鍚嶈瘑鍒?
2銆丆緙栬瘧鏃跺嚱鏁板悕淇グ綰﹀畾瑙勫垯錛?
__stdcall璋冪敤綰﹀畾鍦ㄨ緭鍑哄嚱鏁板悕鍓嶅姞涓婁竴涓笅鍒掔嚎鍓嶇紑錛屽悗闈㈠姞涓婁竴涓?@"絎﹀彿鍜屽叾鍙傛暟鐨勫瓧鑺傛暟錛屾牸寮忎負_functionname@number,渚嬪 錛歠unction(int a, int b)錛屽叾淇グ鍚嶄負錛歘function@8
__cdecl璋冪敤綰﹀畾浠呭湪杈撳嚭鍑芥暟鍚嶅墠鍔犱笂涓涓笅鍒掔嚎鍓嶇紑錛屾牸寮忎負_functionname銆?
__fastcall璋冪敤綰﹀畾鍦ㄨ緭鍑哄嚱鏁板悕鍓嶅姞涓婁竴涓?@"絎﹀彿錛屽悗闈篃鏄竴涓?@"絎﹀彿鍜屽叾鍙傛暟鐨勫瓧鑺傛暟錛屾牸寮忎負@functionname@number銆?

3銆丆++緙栬瘧鏃跺嚱鏁板悕淇グ綰﹀畾瑙勫垯錛?
__stdcall璋冪敤綰﹀畾錛?
1)銆佷互"?"鏍囪瘑鍑芥暟鍚嶇殑寮濮嬶紝鍚庤窡鍑芥暟鍚嶏紱
2)銆佸嚱鏁板悕鍚庨潰浠?@@YG"鏍囪瘑鍙傛暟琛ㄧ殑寮濮嬶紝鍚庤窡鍙傛暟琛紱
3)銆佸弬鏁拌〃浠ヤ唬鍙瘋〃紺猴細
X--void 錛?
D--char錛?
E--unsigned char錛?
F--short錛?
H--int錛?
I--unsigned int錛?
J--long錛?
K--unsigned long錛?
M--float錛?
N--double錛?
_N--bool錛?
PA--琛ㄧず鎸囬拡錛屽悗闈㈢殑浠e彿琛ㄦ槑鎸囬拡綾誨瀷錛屽鏋滅浉鍚岀被鍨嬬殑鎸囬拡榪炵畫鍑虹幇錛屼互"0"浠f浛錛屼竴涓?0"浠h〃涓嬈¢噸澶嶏紱
4)銆佸弬鏁拌〃鐨勭涓欏逛負璇ュ嚱鏁扮殑榪斿洖鍊肩被鍨嬶紝鍏跺悗渚濇涓哄弬鏁扮殑鏁版嵁綾誨瀷,鎸囬拡鏍囪瘑鍦ㄥ叾鎵鎸囨暟鎹被鍨嬪墠錛?
5)銆佸弬鏁拌〃鍚庝互"@Z"鏍囪瘑鏁翠釜鍚嶅瓧鐨勭粨鏉燂紝濡傛灉璇ュ嚱鏁版棤鍙傛暟錛屽垯浠?Z"鏍囪瘑緇撴潫銆?
鍏舵牸寮忎負"?functionname@@YG*****@Z"鎴??functionname@@YG*XZ"錛屼緥濡?
int Test1(char *var1,unsigned long)-----“?Test1@@YGHPADK@Z”
void Test2() -----“?Test2@@YGXXZ”

__cdecl璋冪敤綰﹀畾錛?
瑙勫垯鍚屼笂闈㈢殑_stdcall璋冪敤綰﹀畾錛屽彧鏄弬鏁拌〃鐨勫紑濮嬫爣璇嗙敱涓婇潰鐨?@@YG"鍙樹負"@@YA"銆?
__fastcall璋冪敤綰﹀畾錛?
瑙勫垯鍚屼笂闈㈢殑_stdcall璋冪敤綰﹀畾錛屽彧鏄弬鏁拌〃鐨勫紑濮嬫爣璇嗙敱涓婇潰鐨?@@YG"鍙樹負"@@YI"銆?
VC++瀵瑰嚱鏁扮殑鐪佺己澹版槑鏄?__cedcl",灝嗗彧鑳借C/C++璋冪敤.
娉ㄦ剰錛?
1銆乢beginthread闇瑕乢_cdecl鐨勭嚎紼嬪嚱鏁板湴鍧錛宊beginthreadex鍜孋reateThread闇瑕乢_stdcall鐨勭嚎紼嬪嚱鏁板湴鍧銆?

2銆佷竴鑸琖IN32鐨勫嚱鏁伴兘鏄痏_stdcall銆傝屼笖鍦╓indef.h涓湁濡備笅鐨勫畾涔夛細
#define CALLBACK __stdcall
#define WINAPI銆 __stdcall

3銆乪xtern "C" _declspec(dllexport) int __cdecl Add(int a, int b);
typedef int (__cdecl*FunPointer)(int a, int b);
淇グ絎︾殑涔﹀啓欏哄簭濡備笂銆?

4銆? extern "C"鐨勪綔鐢細濡傛灉Add(int a, int b)鏄湪c璇█緙栬瘧鍣ㄧ紪璇戯紝鑰屽湪c++鏂囦歡浣跨敤錛屽垯闇瑕佸湪c++鏂囦歡涓0鏄庯細extern "C" Add(int a, int b)錛屽洜涓篶緙栬瘧鍣ㄥ拰c++緙栬瘧鍣ㄥ鍑芥暟鍚嶇殑瑙i噴涓嶄竴鏍鳳紙c++緙栬瘧鍣ㄨВ閲婂嚱鏁板悕鐨勬椂鍊欒鑰冭檻鍑芥暟鍙傛暟錛岃繖鏍鋒槸浜嗘柟渚垮嚱鏁伴噸杞斤紝鑰屽湪c璇█涓笉瀛樺湪鍑芥暟閲? 杞界殑闂錛夛紝浣跨敤extern "C"錛屽疄璐ㄥ氨鏄憡璇塩++緙栬瘧鍣紝璇ュ嚱鏁版槸c搴撻噷闈㈢殑鍑芥暟銆傚鏋滀笉浣跨敤extern "C"鍒欎細鍑虹幇閾炬帴閿欒銆?
涓鑸薄濡備笅浣跨敤錛?
#ifdef _cplusplus
#define EXTERN_C extern "C"
#else
#define EXTERN_C extern
#endif

#ifdef _cplusplus
extern "C"{
#endif
EXTERN_C int func(int a, int b);
#ifdef _cplusplus
}
#endif

5銆丮FC鎻愪緵浜嗕竴浜涘畯錛屽彲浠ヤ嬌鐢ˋFX_EXT_CLASS鏉ヤ唬鏇縚_declspec(DLLexport)錛屽茍淇グ綾誨悕錛屼粠鑰屽鍑虹被錛孉FX_API_EXPORT鏉ヤ慨楗板嚱鏁幫紝AFX_DATA_EXPORT鏉ヤ慨楗板彉閲?
AFX_CLASS_IMPORT錛歘_declspec(DLLexport)
AFX_API_IMPORT錛歘_declspec(DLLexport)
AFX_DATA_IMPORT錛歘_declspec(DLLexport)
AFX_CLASS_EXPORT錛歘_declspec(DLLexport)
AFX_API_EXPORT錛歘_declspec(DLLexport)
AFX_DATA_EXPORT錛歘_declspec(DLLexport)
AFX_EXT_CLASS錛?ifdef _AFXEXT
AFX_CLASS_EXPORT
#else
AFX_CLASS_IMPORT

6銆? DLLMain璐熻矗鍒濆鍖?Initialization)鍜岀粨鏉?Termination)宸ヤ綔錛屾瘡褰撲竴涓柊鐨勮繘紼嬫垨鑰呰榪涚▼鐨勬柊鐨勭嚎紼嬭闂瓺LL鏃訛紝 鎴栬呰闂瓺LL鐨勬瘡涓涓繘紼嬫垨鑰呯嚎紼嬩笉鍐嶄嬌鐢―LL鎴栬呯粨鏉熸椂錛岄兘浼氳皟鐢―LLMain銆備絾鏄紝浣跨敤TerminateProcess鎴? TerminateThread緇撴潫榪涚▼鎴栬呯嚎紼嬶紝涓嶄細璋冪敤DLLMain銆?

7銆佷竴涓狣LL鍦ㄥ唴瀛樹腑鍙湁涓涓疄渚?
DLL紼嬪簭鍜岃皟鐢ㄥ叾杈撳嚭鍑芥暟鐨勭▼搴忕殑鍏崇郴錛?
1)銆丏LL涓庤繘紼嬨佺嚎紼嬩箣闂寸殑鍏崇郴
DLL妯″潡琚槧灝勫埌璋冪敤瀹冪殑榪涚▼鐨勮櫄鎷熷湴鍧絀洪棿銆?
DLL浣跨敤鐨勫唴瀛樹粠璋冪敤榪涚▼鐨勮櫄鎷熷湴鍧絀洪棿鍒嗛厤錛屽彧鑳借璇ヨ繘紼嬬殑綰跨▼鎵璁塊棶銆?
DLL鐨勫彞鏌勫彲浠ヨ璋冪敤榪涚▼浣跨敤錛涜皟鐢ㄨ繘紼嬬殑鍙ユ焺鍙互琚獶LL浣跨敤銆?
DLLDLL鍙互鏈夎嚜宸辯殑鏁版嵁孌碉紝浣嗘病鏈夎嚜宸辯殑鍫嗘爤錛屼嬌鐢ㄨ皟鐢ㄨ繘紼嬬殑鏍堬紝涓庤皟鐢ㄥ畠鐨勫簲鐢ㄧ▼搴忕浉鍚岀殑鍫嗘爤妯″紡銆?

2)銆佸叧浜庡叡浜暟鎹
DLL 瀹氫箟鐨勫叏灞鍙橀噺鍙互琚皟鐢ㄨ繘紼嬭闂紱DLL鍙互璁塊棶璋冪敤榪涚▼鐨勫叏灞鏁版嵁銆備嬌鐢ㄥ悓涓DLL鐨勬瘡涓涓繘紼嬮兘鏈夎嚜宸辯殑DLL鍏ㄥ眬鍙橀噺瀹炰緥銆傚鏋滃涓嚎紼嬪茍鍙戣闂? 鍚屼竴鍙橀噺錛屽垯闇瑕佷嬌鐢ㄥ悓姝ユ満鍒訛紱瀵逛竴涓狣LL鐨勫彉閲忥紝濡傛灉甯屾湜姣忎釜浣跨敤DLL鐨勭嚎紼嬮兘鏈夎嚜宸辯殑鍊鹼紝鍒欏簲璇ヤ嬌鐢ㄧ嚎紼嬪眬閮ㄥ瓨鍌?TLS錛孴hread Local Strorage)銆?br>



shongbee2 2009-04-02 12:52 鍙戣〃璇勮
]]>
[杞琞C++鎿嶄綔絎﹀彿鐨勪紭鍏堢駭http://m.shnenglu.com/shongbee2/archive/2009/04/01/78561.htmlshongbee2shongbee2Wed, 01 Apr 2009 05:44:00 GMThttp://m.shnenglu.com/shongbee2/archive/2009/04/01/78561.htmlhttp://m.shnenglu.com/shongbee2/comments/78561.htmlhttp://m.shnenglu.com/shongbee2/archive/2009/04/01/78561.html#Feedback0http://m.shnenglu.com/shongbee2/comments/commentRss/78561.htmlhttp://m.shnenglu.com/shongbee2/services/trackbacks/78561.html鍘熸枃鍦板潃錛歨ttp://www.cppreference.com/wiki/operator_precedence
鍝堝搱銆備互鍚庝笉鐢ㄥ埌澶勫幓鐪嬩功鍟︺傝阿璋㈤偅涓摜浠?br>
Operator Description Example Overloadable
Group 1 (no associativity)
:: Scope resolution operator Class::age = 2; NO
Group 2
() Function call isdigit('1') YES
() Member initalization c_tor(int x, int y) : _x(x), _y(y*10){}; YES
[] Array access array[4] = 2; YES
-> Member access from a pointer ptr->age = 34; YES
. Member access from an object obj.age = 34; NO
++ Post-increment for( int i = 0; i < 10; i++ ) cout << i; YES
-- Post-decrement for( int i = 10; i > 0; i-- ) cout << i; YES
const_cast Special cast const_cast<type_to>(type_from); NO
dynamic_cast Special cast dynamic_cast<type_to>(type_from); NO
static_cast Special cast static_cast<type_to>(type_from); NO
reinterpret_cast Special cast reinterpret_cast<type_to>(type_from); NO
typeid Runtime type information cout « typeid(var).name();
cout « typeid(type).name();
NO
Group 3 (right-to-left associativity)
! Logical negation if( !done ) … YES
not Alternate spelling for !
~ Bitwise complement flags = ~flags; YES
compl Alternate spelling for ~
++ Pre-increment for( i = 0; i < 10; ++i ) cout << i; YES
-- Pre-decrement for( i = 10; i > 0; --i ) cout << i; YES
- Unary minus int i = -1; YES
+ Unary plus int i = +1; YES
* Dereference int data = *intPtr; YES
& Address of int *intPtr = &data; YES
new Dynamic memory allocation long *pVar = new long;
MyClass *ptr = new MyClass(args);
YES
new [] Dynamic memory allocation of array long *array = new long[n]; YES
delete Deallocating the memory delete pVar; YES
delete [] Deallocating the memory of array delete [] array; YES
(type) Cast to a given type int i = (int) floatNum; YES
sizeof Return size of an object or type int size = sizeof floatNum;
int size = sizeof(float);
NO
Group 4
->* Member pointer selector ptr->*var = 24; YES
.* Member object selector obj.*var = 24; NO
Group 5
* Multiplication int i = 2 * 4; YES
/ Division float f = 10.0 / 3.0; YES
% Modulus int rem = 4 % 3; YES
Group 6
+ Addition int i = 2 + 3; YES
- Subtraction int i = 5 - 1; YES
Group 7
<< Bitwise shift left int flags = 33 << 1; YES
>> Bitwise shift right int flags = 33 >> 1; YES
Group 8
< Comparison less-than if( i < 42 ) … YES
<= Comparison less-than-or-equal-to if( i <= 42 ) ... YES
> Comparison greater-than if( i > 42 ) … YES
>= Comparison greater-than-or-equal-to if( i >= 42 ) ... YES
Group 9
== Comparison equal-to if( i == 42 ) ... YES
eq Alternate spelling for ==
!= Comparison not-equal-to if( i != 42 ) … YES
not_eq Alternate spelling for !=
Group 10
& Bitwise AND flags = flags & 42; YES
bitand Alternate spelling for &
Group 11
^ Bitwise exclusive OR (XOR) flags = flags ^ 42; YES
xor Alternate spelling for ^
Group 12
| Bitwise inclusive (normal) OR flags = flags | 42; YES
bitor Alternate spelling for |
Group 13
&& Logical AND if( conditionA && conditionB ) … YES
and Alternate spelling for &&
Group 14
|| Logical OR if( conditionA || conditionB ) ... YES
or Alternate spelling for ||
Group 15 (right-to-left associativity)
? : Ternary conditional (if-then-else) int i = (a > b) ? a : b; NO
Group 16 (right-to-left associativity)
= Assignment operator int a = b; YES
+= Increment and assign a += 3; YES
-= Decrement and assign b -= 4; YES
*= Multiply and assign a *= 5; YES
/= Divide and assign a /= 2; YES
%= Modulo and assign a %= 3; YES
&= Bitwise AND and assign flags &= new_flags; YES
and_eq Alternate spelling for &=
^= Bitwise exclusive or (XOR) and assign flags ^= new_flags; YES
xor_eq Alternate spelling for ^=
|= Bitwise normal OR and assign flags |= new_flags; YES
or_eq Alternate spelling for |=
<<= Bitwise shift left and assign flags <<= 2; YES
>>= Bitwise shift right and assign flags >>= 2; YES
Group 17
throw throw exception throw EClass(“Message”); NO
Group 18
, Sequential evaluation operator for( i = 0, j = 0; i < 10; i++, j++ ) … YES

鍝庯紝鏁堟灉娌℃湁閭i噷濂姐傜湅鏉ユ搷浣滆繕闇瑕佺粌涔犮傚懙鍛?br>

shongbee2 2009-04-01 13:44 鍙戣〃璇勮
]]>
c++鎿嶄綔絎﹂噸杞?/title><link>http://m.shnenglu.com/shongbee2/archive/2009/04/01/78554.html</link><dc:creator>shongbee2</dc:creator><author>shongbee2</author><pubDate>Wed, 01 Apr 2009 05:10:00 GMT</pubDate><guid>http://m.shnenglu.com/shongbee2/archive/2009/04/01/78554.html</guid><wfw:comment>http://m.shnenglu.com/shongbee2/comments/78554.html</wfw:comment><comments>http://m.shnenglu.com/shongbee2/archive/2009/04/01/78554.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://m.shnenglu.com/shongbee2/comments/commentRss/78554.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/shongbee2/services/trackbacks/78554.html</trackback:ping><description><![CDATA[     鎽樿: 浠婂ぉ鎴戝涔犵殑鏄疌++鎿嶄綔絎﹂噸杞姐侰++鐨勬搷浣滅閲嶈澆緇機++甯︽潵寰堝ぇ鐨勬柟渚垮拰鐏墊椿鎬с傚彲浠ラ噸杞介噷闈㈠ぇ閮ㄥ垎鎿嶄綔絎︺傝繖鏍峰湪璋冪敤鐨勬椂鍊欏氨浼氱浉瀵圭殑鑷劧鍜岀畝鍗曘傚簾璇濆皯璇達紝鐩存帴濂変笂婧愪唬鐮?鏈夐儴鍒嗙浉鍏崇殑璧勬枡鐨勬敞閲婇兘宸茬粡鍐欏湪婧愪唬鐮佷笂浜?: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighte...  <a href='http://m.shnenglu.com/shongbee2/archive/2009/04/01/78554.html'>闃呰鍏ㄦ枃</a><img src ="http://m.shnenglu.com/shongbee2/aggbug/78554.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/shongbee2/" target="_blank">shongbee2</a> 2009-04-01 13:10 <a href="http://m.shnenglu.com/shongbee2/archive/2009/04/01/78554.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <a href="http://m.shnenglu.com/">青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品</a> <div style="position:fixed;left:-9000px;top:-9000px;"><font id="pjuwb"></font><button id="pjuwb"><pre id="pjuwb"></pre></button><sub id="pjuwb"></sub><tbody id="pjuwb"><var id="pjuwb"><address id="pjuwb"></address></var></tbody><listing id="pjuwb"><label id="pjuwb"><strong id="pjuwb"></strong></label></listing><wbr id="pjuwb"><small id="pjuwb"><tbody id="pjuwb"></tbody></small></wbr><ins id="pjuwb"><xmp id="pjuwb"></xmp></ins><style id="pjuwb"></style><label id="pjuwb"><em id="pjuwb"><li id="pjuwb"></li></em></label><samp id="pjuwb"></samp><menu id="pjuwb"><input id="pjuwb"></input></menu><pre id="pjuwb"><tbody id="pjuwb"><tfoot id="pjuwb"><button id="pjuwb"></button></tfoot></tbody></pre><form id="pjuwb"></form><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"><sup id="pjuwb"></sup></label></style></i><li id="pjuwb"><table id="pjuwb"><abbr id="pjuwb"></abbr></table></li><video id="pjuwb"></video><dfn id="pjuwb"></dfn><progress id="pjuwb"></progress><strong id="pjuwb"></strong><mark id="pjuwb"></mark><em id="pjuwb"></em><tbody id="pjuwb"><p id="pjuwb"><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike></p></tbody><option id="pjuwb"></option><strike id="pjuwb"></strike><u id="pjuwb"></u><td id="pjuwb"><center id="pjuwb"><tr id="pjuwb"></tr></center></td><em id="pjuwb"><mark id="pjuwb"><em id="pjuwb"><tt id="pjuwb"></tt></em></mark></em><strong id="pjuwb"></strong><wbr id="pjuwb"></wbr><s id="pjuwb"></s><strong id="pjuwb"></strong><legend id="pjuwb"></legend><nav id="pjuwb"></nav><dl id="pjuwb"><th id="pjuwb"><dl id="pjuwb"></dl></th></dl><noframes id="pjuwb"><ins id="pjuwb"></ins></noframes><font id="pjuwb"></font><strike id="pjuwb"><i id="pjuwb"><style id="pjuwb"><label id="pjuwb"></label></style></i></strike><output id="pjuwb"></output><thead id="pjuwb"><pre id="pjuwb"></pre></thead><source id="pjuwb"></source><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem><pre id="pjuwb"><span id="pjuwb"><pre id="pjuwb"><big id="pjuwb"></big></pre></span></pre><cite id="pjuwb"><fieldset id="pjuwb"><s id="pjuwb"><rt id="pjuwb"></rt></s></fieldset></cite><big id="pjuwb"><progress id="pjuwb"><big id="pjuwb"></big></progress></big><samp id="pjuwb"><delect id="pjuwb"></delect></samp><dl id="pjuwb"></dl><strike id="pjuwb"><nav id="pjuwb"><dl id="pjuwb"><strong id="pjuwb"></strong></dl></nav></strike><tbody id="pjuwb"><b id="pjuwb"><optgroup id="pjuwb"><rp id="pjuwb"></rp></optgroup></b></tbody><em id="pjuwb"></em><xmp id="pjuwb"><blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote></xmp> <i id="pjuwb"><abbr id="pjuwb"><i id="pjuwb"><abbr id="pjuwb"></abbr></i></abbr></i><center id="pjuwb"><acronym id="pjuwb"><center id="pjuwb"></center></acronym></center><pre id="pjuwb"></pre><ul id="pjuwb"><thead id="pjuwb"></thead></ul><blockquote id="pjuwb"><pre id="pjuwb"><sup id="pjuwb"></sup></pre></blockquote><acronym id="pjuwb"></acronym><big id="pjuwb"><s id="pjuwb"></s></big><th id="pjuwb"></th><th id="pjuwb"></th><tbody id="pjuwb"></tbody><thead id="pjuwb"><strike id="pjuwb"></strike></thead><th id="pjuwb"><dl id="pjuwb"><wbr id="pjuwb"></wbr></dl></th><dl id="pjuwb"><strong id="pjuwb"></strong></dl><abbr id="pjuwb"><noframes id="pjuwb"><noscript id="pjuwb"></noscript></noframes></abbr><td id="pjuwb"><ol id="pjuwb"></ol></td><li id="pjuwb"><noscript id="pjuwb"><abbr id="pjuwb"></abbr></noscript></li><small id="pjuwb"><bdo id="pjuwb"><nav id="pjuwb"></nav></bdo></small><style id="pjuwb"></style><optgroup id="pjuwb"><table id="pjuwb"></table></optgroup><center id="pjuwb"><tr id="pjuwb"><dfn id="pjuwb"></dfn></tr></center><th id="pjuwb"></th><u id="pjuwb"></u><tfoot id="pjuwb"><legend id="pjuwb"><i id="pjuwb"></i></legend></tfoot><mark id="pjuwb"></mark><meter id="pjuwb"></meter><nav id="pjuwb"></nav><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><acronym id="pjuwb"><pre id="pjuwb"><acronym id="pjuwb"><ul id="pjuwb"></ul></acronym></pre></acronym><nobr id="pjuwb"></nobr><sub id="pjuwb"><th id="pjuwb"><menuitem id="pjuwb"><wbr id="pjuwb"></wbr></menuitem></th></sub><thead id="pjuwb"><sub id="pjuwb"></sub></thead><ul id="pjuwb"><address id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></address></ul><dfn id="pjuwb"></dfn><pre id="pjuwb"></pre><input id="pjuwb"><cite id="pjuwb"><fieldset id="pjuwb"></fieldset></cite></input><u id="pjuwb"><form id="pjuwb"><u id="pjuwb"></u></form></u><kbd id="pjuwb"><em id="pjuwb"><mark id="pjuwb"></mark></em></kbd><tr id="pjuwb"></tr><del id="pjuwb"><form id="pjuwb"><address id="pjuwb"></address></form></del><tfoot id="pjuwb"><legend id="pjuwb"><ol id="pjuwb"><dl id="pjuwb"></dl></ol></legend></tfoot><menu id="pjuwb"><nobr id="pjuwb"><th id="pjuwb"><nobr id="pjuwb"></nobr></th></nobr></menu><fieldset id="pjuwb"></fieldset><pre id="pjuwb"><blockquote id="pjuwb"><samp id="pjuwb"></samp></blockquote></pre><xmp id="pjuwb"><sup id="pjuwb"><pre id="pjuwb"></pre></sup></xmp><span id="pjuwb"><progress id="pjuwb"></progress></span><font id="pjuwb"></font><var id="pjuwb"><abbr id="pjuwb"></abbr></var><strong id="pjuwb"><label id="pjuwb"><i id="pjuwb"><legend id="pjuwb"></legend></i></label></strong><tr id="pjuwb"><em id="pjuwb"><em id="pjuwb"><output id="pjuwb"></output></em></em></tr><thead id="pjuwb"><strike id="pjuwb"></strike></thead> <acronym id="pjuwb"></acronym><i id="pjuwb"></i><tt id="pjuwb"></tt><rt id="pjuwb"><source id="pjuwb"><rt id="pjuwb"></rt></source></rt><strike id="pjuwb"><acronym id="pjuwb"></acronym></strike><del id="pjuwb"></del><font id="pjuwb"><output id="pjuwb"><ins id="pjuwb"><output id="pjuwb"></output></ins></output></font><kbd id="pjuwb"><tr id="pjuwb"><kbd id="pjuwb"></kbd></tr></kbd><pre id="pjuwb"><sup id="pjuwb"><delect id="pjuwb"><samp id="pjuwb"></samp></delect></sup></pre><samp id="pjuwb"></samp><track id="pjuwb"></track><tr id="pjuwb"></tr><center id="pjuwb"></center><fieldset id="pjuwb"></fieldset><i id="pjuwb"></i><td id="pjuwb"></td><rt id="pjuwb"></rt><object id="pjuwb"></object><pre id="pjuwb"><progress id="pjuwb"><sub id="pjuwb"><thead id="pjuwb"></thead></sub></progress></pre><kbd id="pjuwb"><tr id="pjuwb"><option id="pjuwb"></option></tr></kbd><output id="pjuwb"><ins id="pjuwb"></ins></output><ol id="pjuwb"></ol><source id="pjuwb"></source><strong id="pjuwb"></strong><ruby id="pjuwb"></ruby><sub id="pjuwb"><meter id="pjuwb"><menuitem id="pjuwb"><meter id="pjuwb"></meter></menuitem></meter></sub><pre id="pjuwb"></pre><center id="pjuwb"></center><tr id="pjuwb"><tbody id="pjuwb"><xmp id="pjuwb"><dd id="pjuwb"></dd></xmp></tbody></tr><video id="pjuwb"></video><pre id="pjuwb"></pre><form id="pjuwb"><optgroup id="pjuwb"></optgroup></form><samp id="pjuwb"></samp><kbd id="pjuwb"></kbd><strong id="pjuwb"><option id="pjuwb"></option></strong><object id="pjuwb"></object><abbr id="pjuwb"><noframes id="pjuwb"><abbr id="pjuwb"></abbr></noframes></abbr><ul id="pjuwb"><del id="pjuwb"><button id="pjuwb"><pre id="pjuwb"></pre></button></del></ul><abbr id="pjuwb"></abbr><strong id="pjuwb"><code id="pjuwb"><strong id="pjuwb"></strong></code></strong><option id="pjuwb"></option><optgroup id="pjuwb"><bdo id="pjuwb"><code id="pjuwb"></code></bdo></optgroup><mark id="pjuwb"><em id="pjuwb"><font id="pjuwb"></font></em></mark><acronym id="pjuwb"><code id="pjuwb"></code></acronym><dl id="pjuwb"></dl><em id="pjuwb"></em><object id="pjuwb"><input id="pjuwb"><object id="pjuwb"></object></input></object><output id="pjuwb"><dd id="pjuwb"></dd></output><option id="pjuwb"><button id="pjuwb"><option id="pjuwb"></option></button></option><small id="pjuwb"></small></div> <a href="http://kk553.com" target="_blank">欧美在线亚洲一区</a>| <a href="http://133868.com" target="_blank">久久精品国产亚洲精品</a>| <a href="http://39ddtv.com" target="_blank">久久久久久久久蜜桃</a>| <a href="http://5a07.com" target="_blank">欧美激情导航</a>| <a href="http://yh5557.com" target="_blank">久久成人18免费网站</a>| <a href="http://my6557.com" target="_blank">亚洲免费在线播放</a>| <a href="http://www-440450.com" target="_blank">欧美另类综合</a>| <a href="http://2111952.com" target="_blank">翔田千里一区二区</a>| <a href="http://sxxawef.com" target="_blank">亚洲第一视频网站</a>| <a href="http://jiangnanmm.com" target="_blank">亚洲欧美韩国</a>| <a href="http://6623555.com" target="_blank">亚洲精品在线看</a>| <a href="http://ynjzwh.com" target="_blank">欧美国产日韩a欧美在线观看</a>| <a href="http://ybshg.com" target="_blank">亚洲日韩中文字幕在线播放</a>| <a href="http://gaysexcube.com" target="_blank">亚洲天堂成人</a>| <a href="http://wwwok1965.com" target="_blank">亚洲精品国产拍免费91在线</a>| <a href="http://149155.com" target="_blank">亚洲大胆人体视频</a>| <a href="http://ks180.com" target="_blank">亚洲一区二区不卡免费</a>| <a href="http://aqdav037.com" target="_blank">亚洲高清视频的网址</a>| <a href="http://bbbbyb.com" target="_blank">亚洲精品美女免费</a>| <a href="http://www38044.com" target="_blank">亚洲美女区一区</a>| <a href="http://cgnwp.com" target="_blank">欧美日本一道本</a>| <a href="http://azaz7.com" target="_blank">午夜精品久久99蜜桃的功能介绍</a>| <a href="http://yahuake.com" target="_blank">久久精品国产视频</a>| <a href="http://9ctv2.com" target="_blank">欧美一区二区三区精品电影</a>| <a href="http://xccp4888.com" target="_blank">日韩一级黄色av</a>| <a href="http://2343ww.com" target="_blank">欧美日韩国产精品一卡</a>| <a href="http://g2000vip.com" target="_blank">欧美在线中文字幕</a>| <a href="http://jav69me.com" target="_blank">久久久高清一区二区三区</a>| <a href="http://124909.com" target="_blank">一二美女精品欧洲</a>| <a href="http://lao64.com" target="_blank">亚洲一区二区免费</a>| <a href="http://92ye.com" target="_blank">国产精品99久久不卡二区</a>| <a href="http://yjizzdizhigmail.com" target="_blank">亚洲国产精品一区二区第一页</a>| <a href="http://110673.com" target="_blank">国产精品久久久久久影视 </a>| <a href="http://kk66mm.com" target="_blank">久久久久久9</a>| <a href="http://neudlac.com" target="_blank">亚洲高清精品中出</a>| <a href="http://ourskycity.com" target="_blank">亚洲一区二区三区在线看</a>| <a href="http://894322.com" target="_blank">在线一区欧美</a>| <a href="http://hcbr365.com" target="_blank">日韩午夜激情av</a>| <a href="http://798814.com" target="_blank">日韩视频免费看</a>| <a href="http://4466777.com" target="_blank">亚洲精品影院</a>| <a href="http://jxjx11.com" target="_blank">免费在线观看日韩欧美</a>| <a href="http://4123123.com" target="_blank">夜夜爽99久久国产综合精品女不卡</a>| <a href="http://eeii33.com" target="_blank">先锋影音国产精品</a>| <a href="http://921367.com" target="_blank">欧美在线视频二区</a>| <a href="http://444398.com" target="_blank">亚洲专区在线</a>| <a href="http://18loutv.com" target="_blank">99视频+国产日韩欧美</a>| <a href="http://989766.com" target="_blank">久久天堂成人</a>| <a href="http://557523.com" target="_blank">亚洲在线视频一区</a>| <a href="http://5252bnet.com" target="_blank">日韩午夜av</a>| <a href="http://215920.com" target="_blank">日韩视频一区二区三区在线播放免费观看 </a>| <a href="http://rezel-zj.com" target="_blank">亚洲专区在线视频</a>| <a href="http://www-878899.com" target="_blank">亚洲欧美视频在线观看</a>| <a href="http://unrealcopgmail.com" target="_blank">亚洲欧美日韩精品久久奇米色影视</a>| <a href="http://caoliu20.com" target="_blank">欧美日韩一区国产</a>| <a href="http://www-222kkk.com" target="_blank">欧美母乳在线</a>| <a href="http://029902.com" target="_blank">欧美日韩国产一级</a>| <a href="http://www-77663.com" target="_blank">国产精品久久久久久久久免费桃花 </a>| <a href="http://sapronlee.com" target="_blank">亚洲午夜激情免费视频</a>| <a href="http://6666785.com" target="_blank">欧美高清视频</a>| <a href="http://scptw.com" target="_blank">中文欧美字幕免费</a>| <a href="http://thisisfil.com" target="_blank">亚洲视频精品</a>| <a href="http://alex-bruni.com" target="_blank">亚洲中字在线</a>| <a href="http://894322.com" target="_blank">黑丝一区二区三区</a>| <a href="http://shwazrbjd.com" target="_blank">国产亚洲精品bv在线观看</a>| <a href="http://044925.com" target="_blank">欧美一区二区三区四区在线 </a>| <a href="http://www-333410.com" target="_blank">欧美福利精品</a>| <a href="http://yx3369.com" target="_blank">欧美久久一级</a>| <a href="http://tzhbsb.com" target="_blank">日韩网站在线看片你懂的</a>| <a href="http://wwwhaodd116.com" target="_blank">亚洲激情网站</a>| <a href="http://qkspvip.com" target="_blank">欧美激情一区在线观看</a>| <a href="http://9966k.com" target="_blank">亚洲午夜精品久久</a>| <a href="http://92xx00.com" target="_blank">欧美一二三区在线观看</a>| <a href="http://yp8882.com" target="_blank">欧美jizz19性欧美</a>| <a href="http://llamkos.com" target="_blank">一区二区三区中文在线观看 </a>| <a href="http://www-137999.com" target="_blank">欧美黄色精品</a>| <a href="http://www330088.com" target="_blank">快she精品国产999</a>| <a href="http://my736.com" target="_blank">亚洲国产欧美一区</a>| <a href="http://312012.com" target="_blank">国产精品你懂的</a>| <a href="http://13501680.com" target="_blank">亚洲精品日韩在线观看</a>| <a href="http://022291.com" target="_blank">欧美激情一二三区</a>| <a href="http://senlin86.com" target="_blank">免费不卡视频</a>| <a href="http://39ddtv.com" target="_blank">一本一道久久综合狠狠老精东影业</a>| <a href="http://3644688.com" target="_blank">最新日韩在线视频</a>| <a href="http://laoyewo.com" target="_blank">美国十次成人</a>| <a href="http://jjy891.com" target="_blank">欧美一区二区三区四区在线</a>| <a href="http://dacellflex.com" target="_blank">欧美午夜精彩</a>| <a href="http://91ypp.com" target="_blank">国产日韩欧美成人</a>| <a href="http://www789yys.com" target="_blank">亚洲久久一区二区</a>| <a href="http://www993997.com" target="_blank">免费av成人在线</a>| <a href="http://hhbz518.com" target="_blank">亚洲欧美日韩一区</a>| <a href="http://1515t.com" target="_blank">欧美网站在线观看</a>| <a href="http://tavbao.com" target="_blank">亚洲国产精品综合</a>| <a href="http://xianqyd.com" target="_blank">久久亚洲精品网站</a>| <a href="http://707fx.com" target="_blank">亚洲欧美在线免费</a>| <a href="http://hnautos.com" target="_blank">欧美日韩亚洲不卡</a>| <a href="http://heyzo1199.com" target="_blank">亚洲激情国产精品</a>| <a href="http://www-90422.com" target="_blank">久久尤物视频</a>| <a href="http://428368.com" target="_blank">在线综合亚洲欧美在线视频</a>| <a href="http://nztd20.com" target="_blank">欧美精品免费观看二区</a>| <a href="http://uuuu79.com" target="_blank">亚洲九九精品</a>| <a href="http://bdkaoyan.com" target="_blank">老司机aⅴ在线精品导航</a>| <a href="http://114499com.com" target="_blank">欧美一区二区三区另类</a>| <a href="http://4923cc.com" target="_blank">亚洲一区二区三区精品在线</a>| <a href="http://mes-dvd.com" target="_blank">国产亚洲成年网址在线观看</a>| <a href="http://instantptt.com" target="_blank">麻豆91精品</a>| <a href="http://xmjhyey.com" target="_blank">国产日本欧美一区二区三区</a>| <a href="http://timonna.com" target="_blank">9国产精品视频</a>| <a href="http://miya2223.com" target="_blank">亚洲美女91</a>| <a href="http://xxx444vip.com" target="_blank">欧美成人有码</a>| <a href="http://www-e2222.com" target="_blank">亚洲级视频在线观看免费1级</a>| <a href="http://710557.com" target="_blank">乱码第一页成人</a>| <a href="http://o6186.com" target="_blank">欧美一二区视频</a>| <a href="http://zqx186.com" target="_blank">一区二区在线观看av</a>| <a href="http://devmashup.com" target="_blank">欧美亚洲视频在线看网址</a>| <a href="http://taoh228.com" target="_blank">久久精品人人爽</a>| <a href="http://ww3838.com" target="_blank">亚洲国产精品毛片</a>| <a href="http://1zz8903.com" target="_blank">欧美黑人在线播放</a>| <a href="http://woniuminsu.com" target="_blank">亚洲欧美在线观看</a>| <a href="http://mxkaozi.com" target="_blank">久久综合图片</a>| <a href="http://66gg6.com" target="_blank">亚洲视频播放</a>| <a href="http://www344399.com" target="_blank">在线欧美小视频</a>| <a href="http://caoxiu33.com" target="_blank">久久精品国产久精国产爱</a>| <a href="http://sese699.com" target="_blank">性久久久久久久久</a>| <a href="http://www24822.com" target="_blank">国产精品久久久久久影视</a>| <a href="http://40346c.com" target="_blank">午夜精品影院</a>| <a href="http://www-485050.com" target="_blank">麻豆精品精华液</a>| <a href="http://www-23918.com" target="_blank">影音先锋另类</a>| <a href="http://www-45553.com" target="_blank">亚洲一卡久久</a>| <a href="http://www-662553.com" target="_blank">性视频1819p久久</a>| <a href="http://khc83.com" target="_blank">欧美日韩一区二区三区视频</a>| <a href="http://51120guahao.com" target="_blank">美女图片一区二区</a>| <a href="http://xvideoav99.com" target="_blank">亚洲电影av</a>| <a href="http://884v.com" target="_blank">欧美片第1页综合</a>| <a href="http://xhtd688.com" target="_blank">在线视频你懂得一区</a>| <a href="http://yashikeji.com" target="_blank">夜夜嗨网站十八久久</a>| <a href="http://66889h.com" target="_blank">国产精品―色哟哟</a>| <a href="http://193youwu.com" target="_blank">欧美日韩精品免费观看视一区二区 </a>| <a href="http://278538.com" target="_blank">久久久久久久久久久一区</a>| <a href="http://metagasa.com" target="_blank">一本色道久久综合一区 </a>| <a href="http://7kz6.com" target="_blank">在线看片第一页欧美</a>| <a href="http://www-699603.com" target="_blank">国产乱理伦片在线观看夜一区</a>| <a href="http://91mdtv.com" target="_blank">欧美国产日韩二区</a>| <a href="http://292q.com" target="_blank">久久国产精品久久久久久电车</a>| <a href="http://joy-learn.com" target="_blank">亚洲欧美日韩一区二区三区在线观看</a>| <a href="http://syfeichi.com" target="_blank">中文亚洲视频在线</a>| <a href="http://czsanlin.com" target="_blank">一区二区三区精品视频在线观看</a>| <a href="http://sikixixw12.com" target="_blank">一区二区三区久久</a>| <a href="http://9113c.com" target="_blank">在线中文字幕日韩</a>| <a href="http://8xfore.com" target="_blank">国产一区二区中文</a>| <a href="http://236664.com" target="_blank">久久久久免费观看</a>| <a href="http://848585.com" target="_blank">亚洲精品欧美日韩专区</a>| <a href="http://1000078.com" target="_blank">久久久精品一区二区三区</a>| <a href="http://4923cc.com" target="_blank">日韩系列欧美系列</a>| <a href="http://baluka-tw.com" target="_blank">国内伊人久久久久久网站视频</a>| <a href="http://mxkaozi.com" target="_blank">免费美女久久99</a>| <a href="http://wtoykd.com" target="_blank">免费在线观看精品</a>| <a href="http://fsdashen.com" target="_blank">亚洲五月六月</a>| <a href="http://66889h.com" target="_blank">亚洲电影在线观看</a>| <a href="http://aberyco.com" target="_blank">欧美三区在线视频</a>| <a href="http://889028.com" target="_blank">欧美日韩成人在线视频</a>| <a href="http://hkjccc.com" target="_blank">欧美人与禽猛交乱配</a>| <a href="http://chuangke168.com" target="_blank">久久综合中文色婷婷</a>| <a href="http://hh474.com" target="_blank">西西裸体人体做爰大胆久久久</a>| <a href="http://www888x.com" target="_blank">欧美一区二区三区日韩</a>| <a href="http://4466o.com" target="_blank">亚洲午夜精品福利</a>| <a href="http://ym5571.com" target="_blank">亚洲高清影视</a>| <a href="http://lingshidu.com" target="_blank">国内精品久久久久久久影视麻豆 </a>| <a href="http://ndr666.com" target="_blank">亚洲国产91</a>| <a href="http://118626cc.com" target="_blank">久久九九久精品国产免费直播</a>| <a href="http://rljyy.com" target="_blank">国产一区二三区</a>| <a href="http://yanuoxun.com" target="_blank">国产精品美女视频网站</a>| <a href="http://www-69669.com" target="_blank">欧美国产日韩视频</a>| <a href="http://www77577.com" target="_blank">亚洲免费人成在线视频观看</a>| <a href="http://194123.com" target="_blank">先锋影音久久久</a>| <a href="http://yahuake.com" target="_blank">99视频在线观看一区三区</a>| <a href="http://hellomusiczone.com" target="_blank">噜噜噜躁狠狠躁狠狠精品视频</a>| <a href="http://862323.com" target="_blank">在线观看欧美激情</a>| <a href="http://126900.com" target="_blank">国产精品99久久不卡二区</a>| <a href="http://6u6uuu666.com" target="_blank">国产在线成人</a>| <a href="http://557523.com" target="_blank">国产亚洲精品v</a>| <a href="http://hgx123.com" target="_blank">日韩视频一区二区三区</a>| <a href="http://playav999.com" target="_blank">久久精品国产欧美亚洲人人爽</a>| <a href="http://www39pao.com" target="_blank">国产精品久久久久久久第一福利</a>| <a href="http://xuanxuan88.com" target="_blank">久久精品九九</a>| <a href="http://kakatok.com" target="_blank">欧美国产第一页</a>| <a href="http://036762.com" target="_blank">欧美激情精品久久久久久</a>| <a href="http://3451215.com" target="_blank">国产精品www994</a>| <a href="http://xxx6688.com" target="_blank">国产一区二区三区四区hd</a>| <a href="http://hhsj31.com" target="_blank">亚洲大片av</a>| <a href="http://coolpaly.com" target="_blank">久久久xxx</a>| <a href="http://tk99444.com" target="_blank">一区二区日韩</a>| <a href="http://am3757.com" target="_blank">久久成人精品视频</a>| <a href="http://wzxjzx.com" target="_blank">欧美日韩国产一区</a>| <a href="http://49234c.com" target="_blank">一区在线视频</a>| <a href="http://www31931.com" target="_blank">亚洲一品av免费观看</a>| <a href="http://viwasmart.com" target="_blank">男女激情久久</a>| <a href="http://chukewang.com" target="_blank">亚洲男人第一网站</a>| <a href="http://www473333.com" target="_blank">欧美国产日韩精品免费观看</a>| <a href="http://609005.com" target="_blank">一区二区三区 在线观看视</a>| <a href="http://8eb26.com" 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>