锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产精品青草,欧美黑人又粗又大久久久,国产精品久久久久久久apphttp://www.shnenglu.com/keyws/category/2424.htmlC++ && keyWordSpottingzh-cnThu, 22 May 2008 09:19:01 GMTThu, 22 May 2008 09:19:01 GMT60銆愬師銆戣繍綆楃閲嶈澆涓庡悕瀛楃┖闂寸殑鍥版儜http://www.shnenglu.com/keyws/archive/2006/08/16/11304.htmlkeywskeywsWed, 16 Aug 2006 13:09:00 GMThttp://www.shnenglu.com/keyws/archive/2006/08/16/11304.htmlhttp://www.shnenglu.com/keyws/comments/11304.htmlhttp://www.shnenglu.com/keyws/archive/2006/08/16/11304.html#Feedback0http://www.shnenglu.com/keyws/comments/commentRss/11304.htmlhttp://www.shnenglu.com/keyws/services/trackbacks/11304.html 聽聽聽瀛︿範鏁版嵁緇撴瀯錛岀敤鍒頒簡杈撳叆杈撳嚭榪愮畻絎﹂噸杞斤紝緇撴灉緙栬瘧涔嬩笅錛岄敊璇噸閲嶏紝錛岄殢鍗沖仠姝㈠涔犺繘搴︼紝榪芥煡紲告簮錛屽湪鑺辮垂宸ㄥぇ鑴戝姏涓庢椂闂存垚鏈箣鍚庯紝緇堜簬鐭ヨ嚜宸遍敊璇箣鎵鍦紝瀹氫綅浜庡悕瀛楃┖闂翠箣鍥版壈銆備負鐗㈣鏁欒錛屽啓涓綆鍖栫増鏈褰?/span> debug 榪囩▼濡備笅錛岃紺鴻嚜宸便?br />

闂錛?br />聽聽聽

聽聽聽鏈夊涓嬩袱涓唬鐮佹枃浠訛細
聽聽聽// 20060816_operator.cxx

聽1#include聽<iostream>
聽2usingnamespace聽std;
聽3#include聽"20060816_operator.h"
聽4int聽main(int聽argc,聽char*聽argv[])
聽5{
聽6聽聽聽聽const聽std::string聽GHH("GuoHonghua");
聽7聽聽聽聽Honghua聽ghh(GHH);
聽8聽聽聽聽cout聽<<聽ghh聽<<聽endl;
聽9聽聽聽聽return0;
10}
聽聽聽

// 20060816_operator.h

聽1#ifndef聽_20060816_OPERATOR_GHH_
聽2#define聽_20060816_OPERATOR_GHH_聽聽聽聽1
聽3
聽4//聽Author聽:聽GuoHonghua
聽5//聽Date聽:聽2006.08.16
聽6//聽File聽:聽20060816_operator.h
聽7
聽8#include聽<iostream>
聽9#include聽<string>
10class聽Honghua
11{
12聽聽聽聽friend聽std::ostream&operator<<(std::ostream&聽os,聽const聽Honghua&聽ghh);
13public:
14聽聽聽聽Honghua(const聽std::string&聽ghh)聽:聽_ghh(ghh)
15聽聽聽聽{
16聽聽聽聽}
17
18private:
19聽聽聽聽std::string聽_ghh;
20};
21
22std::ostream&operator<<(std::ostream&聽os,聽const聽Honghua&聽ghh)
23{
24聽聽聽聽os聽<<聽ghh._ghh;
25聽聽聽聽return聽os;
26}
27
28#endif//聽end聽of聽_20060816_OPERATOR_GHH_

鐢ㄤ笂闈袱涓枃浠跺緩绔嬪伐紼嬶紝vc6.0涓嬬紪璇戜細鍑洪敊銆傛姤鍛婂涓嬶細

--------------------Configuration: 20060816_operator - Win32 Debug--------------------

Compiling...

20060816_operator.cxx

f:\ghh_project\cxxdetail\20060816_operator.h(24) : error C2248: '_ghh' : cannot access private member declared in class 'Honghua'

聽聽聽聽聽聽聽 f:\ghh_project\cxxdetail\20060816_operator.h(19) : see declaration of '_ghh'

F:\ghh_project\CxxDetail\20060816_operator.cxx(8) : error C2593: 'operator <<' is ambiguous

Error executing cl.exe.

20060816_operator.exe - 2 error(s), 0 warning(s)
瑙e喅:
聽聽聽

1錛?span style="FONT: 7pt 'Times New Roman'">聽 璋冩暣鍚嶅瓧絀洪棿澹版槑鍜岃嚜瀹氫箟澶存枃浠剁殑嬈″簭錛屽涓嬶細

1#include聽<iostream>
2#include聽"20060816_operator.h"
3usingnamespace聽std;
4int聽main(int聽argc,聽char*聽argv[])
5

2錛?span style="FONT: 7pt 'Times New Roman'">聽 鎶婄被瀹氫箟浜庢爣鍑嗗悕瀛椾箣鍐咃紝20060816_operator.h鏂囦歡淇敼濡備笅錛堜笉鎺ㄨ崘錛?br />

聽1#ifndef聽_20060816_OPERATOR_GHH_
聽2#define聽_20060816_OPERATOR_GHH_聽聽聽聽1
聽3
聽4//聽Author聽:聽GuoHonghua
聽5//聽Date聽:聽2006.08.16
聽6//聽File聽:聽20060816_operator.h
聽7
聽8#include聽<iostream>
聽9#include聽<string>
10namespace聽std
11{
12聽聽聽聽class聽Honghua
13聽聽聽聽{
14聽聽聽聽聽聽聽聽friend聽std::ostream&operator<<(std::ostream&聽os,聽const聽Honghua&聽ghh);
15聽聽聽聽public:
16聽聽聽聽聽聽聽聽Honghua(const聽std::string&聽ghh)聽:聽_ghh(ghh)
17聽聽聽聽聽聽聽聽{
18聽聽聽聽聽聽聽聽}
19聽聽聽聽聽聽聽聽
20聽聽聽聽private:
21聽聽聽聽聽聽聽聽std::string聽_ghh;
22聽聽聽聽};
23聽聽聽聽
24聽聽聽聽
25聽聽聽聽std::ostream&operator<<(std::ostream&聽os,聽const聽Honghua&聽ghh)
26聽聽聽聽{
27聽聽聽聽聽聽聽聽os聽<<聽ghh._ghh;
28聽聽聽聽聽聽聽聽return聽os;
29聽聽聽聽}
30}
31#endif//聽end聽of聽_20060816_OPERATOR_GHH_

3錛?span style="FONT: 7pt 'Times New Roman'">聽 浣跨敤澶存枃浠?/span>iostream.h浠f浛iostream,姣旇緝钀藉悗鐨勬柟寮忥紙涓嶆帹鑽?/span>!錛?br />

聽1//聽20060816_operator.cxx
聽2//聽#include聽<iostream>
聽3#include聽<iostream.h>
聽4#include聽<iostream.h>
聽5#include聽"20060816_operator.h"
聽6int聽main(int聽argc,聽char*聽argv[])
聽7{
聽8聽聽聽聽const聽std::string聽GHH("GuoHonghua");
聽9聽聽聽聽Honghua聽ghh(GHH);
10聽聽聽聽cout聽<<聽ghh聽<<聽endl;
11聽聽聽聽return0;
12}

聽1//聽20060816_operator.h
聽2#ifndef聽_20060816_OPERATOR_GHH_
聽3#define聽_20060816_OPERATOR_GHH_聽聽聽聽1
聽4
聽5//聽Author聽:聽GuoHonghua
聽6//聽Date聽:聽2006.08.16
聽7//聽File聽:聽20060816_operator.h
聽8//聽#include聽<iostream>
聽9#include聽<iostream.h>
10#include聽<string>
11
12class聽Honghua
13{
14聽聽聽聽friend聽ostream&operator<<(ostream&聽os,聽const聽Honghua&聽ghh);
15public:
16聽聽聽聽Honghua(const聽std::string&聽ghh)聽:聽_ghh(ghh)
17聽聽聽聽{
18聽聽聽聽}
19聽聽聽聽
20private:
21聽聽聽聽std::string聽_ghh;
22};
23
24
25ostream&operator<<(ostream&聽os,聽const聽Honghua&聽ghh)
26{
27聽聽聽聽os聽<<聽ghh._ghh;
28聽聽聽聽return聽os;
29}
30
31#endif//聽end聽of聽_20060816_OPERATOR_GHH_

4錛?span style="FONT: 7pt 'Times New Roman'">聽 浠諱綍鏃跺欓兘涓嶄嬌鐢?/span>using namespace 澹版槑錛佽繖鏄彧闇瑕佷慨鏀?/span>20060816_operator.cxx鏂囦歡濡備笅錛?br />

聽1#include聽<iostream>
聽2#include聽"20060816_operator.h"
聽3int聽main(int聽argc,聽char*聽argv[])
聽4{
聽5聽聽聽聽//聽const聽string聽GHH("GuoHonghua");
聽6聽聽聽聽const聽std::string聽GHH("GuoHonghua");
聽7聽聽聽聽Honghua聽ghh(GHH);
聽8聽聽聽聽//聽cout聽<<聽ghh聽<<聽endl;
聽9聽聽聽聽std::cout聽<<聽ghh聽<<聽std::endl;
10聽聽聽聽return0;
11}

浣撲細錛?br />聽聽聽鍚嶅瓧絀洪棿鏈潵灝辨槸涓轟簡瑙e喅鍚嶅瓧鍐茬獊闂鑰屽紩鍏ワ紝浠ヤ嬌鏍囧噯搴撲笉鍙楀鐣屽獎鍝嶃傚湪榪欎釜鎰忎箟涓婃潵璇達紝using namespace std;涓嶆槸鍙互闅忔剰浣跨敤鐨勮鍙ワ紝搴旇鑰冭檻鍒板畠鐨勪綅緗紼嬪簭鐨勫彲鑳藉獎鍝嶏紝鑰屾渶褰誨簳鐨勬潨緇濋敊璇殑瑙e喅鍔炴硶鏄湪浠諱綍鏃跺欎換浣曟儏鍐典笅閮戒笉浣跨敤姝よ鍙ワ紒



keyws 2006-08-16 21:09 鍙戣〃璇勮
]]>
銆愬師銆戜竴涓叧浜庡嚱鏁版ā鐗堢紪璇戦敊璇殑璋冭瘯璁板綍http://www.shnenglu.com/keyws/archive/2006/08/12/11154.htmlkeywskeywsSat, 12 Aug 2006 12:32:00 GMThttp://www.shnenglu.com/keyws/archive/2006/08/12/11154.htmlhttp://www.shnenglu.com/keyws/comments/11154.htmlhttp://www.shnenglu.com/keyws/archive/2006/08/12/11154.html#Feedback0http://www.shnenglu.com/keyws/comments/commentRss/11154.htmlhttp://www.shnenglu.com/keyws/services/trackbacks/11154.html 聽聽聽聽聽聽 鍒濆鍑芥暟妯$増錛屼竴涓?/span> bug鈥?/span> 璁╀亢閮侀椃浜嗕竴鐣紝鎯充簡涓涓皬鏃墮兘娌℃湁鎯沖嚭鎵浠ョ劧銆傝櫧姹傚姪浜庣綉緇滐紝鍙戣創浜?/span> vckbase 銆?/span>

聽聽聽聽聽聽 闂宸茬粡瑙e喅錛屽笘瀛愭憳瑕佸涓嬶細

涓?span lang="EN-US">聽聽聽聽聽聽棰?span lang="EN-US">: 鍑芥暟妯$増闂錛屼負浠涔堜笉鑳介噰鐢ㄥ鏂囦歡鏂瑰紡銆?span lang="EN-US">聽
浣?span lang="EN-US">聽聽聽聽聽聽鑰?span lang="EN-US">: 閮櫒 ( 涔︾)
鎵灞炶鍧?span lang="EN-US">: C++ 璁哄潧
鏈笘鍒嗘暟: 0
鍥炲嬈℃暟: 4
鍙戣〃鏃墮棿: 2006-8-12 19:09:50
姝f枃鍐呭:
1
錛?span lang="EN-US">
#include <fstream>
#include <iostream>
using namespace std;
template<class Type >
Type min(Type a, Type b)
{
聽聽聽聽return a < b ? a : b;
}

int main(int argc, char* argv[])
{
聽聽聽聽cout << min(10, 20) << endl;
聽聽聽聽return 0;
}

鍙互緙栬瘧鎴愬姛錛岃繍琛屽緱鍒版紜粨鏋溿?span lang="EN-US">

2錛夊鏂囦歡鏂瑰紡

///////////////////////main.cxx
#include "min.h"
#include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
聽聽聽聽cout << min(10, 20) << endl;
聽聽聽聽return 0;
}
///////////////////////min.h
#ifndef _MIN_GHH_
#define _MIN_GHH_聽聽1

template<class Type >
Type min(Type a, Type b);

#endif

//////////////////////min.cxx
#include "min.h"

template<class Type >
Type min(Type a, Type b)
{
聽聽聽聽return a < b ? a : b;
}

緙栬瘧鎶ュ憡閿欒錛?span lang="EN-US">
Linking...
20060812_function_template.obj : error LNK2001: unresolved external symbol "int __cdecl min(int,int)" (?min@@YAHHH@Z)
Debug/20060812_function_template.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

20060812_function_template.exe - 2 error(s), 0 warning(s)

////////////////////////////////////
闂錛氫負浠涔堜細鍑虹幇榪欑闂錛屽浣曡В鍐籌紵鐩艱祼鏁欍?span lang="EN-US">
鏈鏂頒慨鏀?span lang="EN-US">:2006-8-12 19:41:10

鍥炲浜?span lang="EN-US">: newgun ( 涔︾)聽

2006-8-12 19:34:29 ( 寰楀垎: 10 )聽

Re: 鍑芥暟妯$増闂錛屼負浠涔堜笉鑳介噰鐢ㄥ鏂囦歡鏂瑰紡銆?span lang="EN-US">
鍦?span lang="EN-US">c++鏍囧噯涓瀹氬彲浠ラ噰鐢ㄥ垎紱葷殑緙栬瘧妯″紡錛屽彧闇瑕侀氳繃鍦ㄦā鏉垮畾涔変腑鐨勫叧閿瓧template 涔嬪墠鍔犱笂鍏抽敭瀛?span lang="EN-US">export 鏉ュ0鏄庝竴涓彲瀵煎嚭鐨勫嚱鏁版ā鏉垮綋鍑芥暟妯℃澘錛岃瀵煎嚭鏃舵垜浠氨鍙互鍦ㄤ換鎰忕▼搴忔枃鏈枃浠朵腑浣跨敤妯℃澘鐨勫疄渚嬪錛?span lang="EN-US">
聽聽// model2.h
// 鍒嗙妯″紡: 鍙彁渚涙ā鏉垮0鏄?span lang="EN-US">
template <typename Type> Type min( Type t1, Type t2 );
// model2.C
// the template definition
export template <typename Type>聽聽聽聽//export鍏抽敭瀛?span lang="EN-US">
Type min( Type t1, Type t2 ) { /* ...*/ }

聽聽聽聽浣嗘槸濂藉儚鐜板湪鐨勫ソ澶氱紪璇戝櫒濡?span lang="EN-US">vc7閮借繕涓嶆敮鎸佽繖縐嶇粨鏋勶紝鎵浠ユ渶濂芥妸妯℃澘鐨勫0鏄?/font>
鍜屽畾涔夐兘鏀懼湪澶存枃浠墮噷銆?span lang="EN-US">

聽聽聽聽聽

聽聽聽聽聽聽 鎰熷彈錛氬緱鍒扮綉鍙嬫彁紺猴紝鐪熸湁涓縐嶁滄煶鏆楄姳鏄庡張涓鏉戔濅箣鎰燂紝榪欎釜鎵璋?/span> bug 鏄繖涔堢畝鍗曞張鏄繖涔堜笉綆鍗曪紒

聽聽聽聽聽聽 涓鐩磋涓哄簲璇ユ槸鑷繁鐨勯敊璇紝浣嗘病鎯沖埌鏄紪璇戝櫒鍜屾爣鍑嗗吋瀹規х殑闂銆傜湅鏉ヨ嚜宸辯殑鎬濈淮涔犳儻搴旇鏈夋墍鏀瑰彉浜嗐傚簲璇ュ瑙掑害鍒嗘瀽闂錛岃屼笉鑳戒竴鍛崇殑鎯沖綋鐒躲?/span>

聽聽聽聽聽聽 Ps 錛氳嚜宸變篃搴旇鑰冭檻灝濊瘯涓涓柊鐨?/span> C++ 緙栬瘧鍣ㄤ簡錛岃佺敤 vc 錛屾劅瑙夊鐨勬爣鍑?/span> C++ 閮戒笉綰紝灝辮薄榪欐浜嬩歡涓鏍楓?/span>



keyws 2006-08-12 20:32 鍙戣〃璇勮
]]>
久久精品国产精品亚洲精品| 91视频国产91久久久| 国产亚州精品女人久久久久久 | 青青草国产精品久久久久| 女人香蕉久久**毛片精品| 韩国三级中文字幕hd久久精品| 亚洲精品NV久久久久久久久久| 精品久久久无码人妻中文字幕 | 91久久精一区二区三区大全| 大香网伊人久久综合网2020| 久久九九久精品国产免费直播| MM131亚洲国产美女久久| 久久午夜综合久久| 91精品国产高清久久久久久io| 久久av高潮av无码av喷吹| 亚洲精品国产字幕久久不卡 | 久久se精品一区二区| 亚洲精品午夜国产va久久| 国产精品久久久久久| 国产精品久久久久a影院| 亚洲天堂久久精品| 久久国产精品一国产精品金尊| 日韩AV毛片精品久久久| 婷婷久久综合九色综合98| 亚洲精品无码久久久久去q| 久久99精品久久久久久齐齐| 国产日产久久高清欧美一区| 日产精品久久久久久久性色| 亚洲人成无码www久久久| 久久av免费天堂小草播放| 久久电影网一区| 国内精品久久久久| 久久久久久午夜成人影院| 99久久国产综合精品女同图片| 亚洲Av无码国产情品久久| 久久国产视屏| 久久夜色精品国产www| 亚洲欧美成人久久综合中文网 | 国产69精品久久久久9999APGF| 欧美精品丝袜久久久中文字幕| 久久毛片免费看一区二区三区|