锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产三级精品三级,国内成+人亚洲+欧美+综合在线,国产精品丝袜91http://www.shnenglu.com/ashura/zh-cnWed, 03 Dec 2025 03:35:18 GMTWed, 03 Dec 2025 03:35:18 GMT60銆怓AQ銆慠PM杞歡鍖呬嬌鐢ㄥ父瑙侀棶棰?[ZZ]http://www.shnenglu.com/ashura/archive/2007/08/20/30420.htmlashuraashuraMon, 20 Aug 2007 05:21:00 GMThttp://www.shnenglu.com/ashura/archive/2007/08/20/30420.htmlhttp://www.shnenglu.com/ashura/comments/30420.htmlhttp://www.shnenglu.com/ashura/archive/2007/08/20/30420.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/30420.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/30420.html闃呰鍏ㄦ枃

ashura 2007-08-20 13:21 鍙戣〃璇勮
]]>
鑺卞績鑺辮http://www.shnenglu.com/ashura/archive/2007/04/28/23100.htmlashuraashuraSat, 28 Apr 2007 04:25:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/28/23100.htmlhttp://www.shnenglu.com/ashura/comments/23100.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/28/23100.html#Feedback1http://www.shnenglu.com/ashura/comments/commentRss/23100.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/23100.html
縐嶇被 钄瘋枃縐?

鍒悕 鏃?

浜у湴 涓浗銆佹棩鏈佸彴婀?

鑺辮壊 鑺辮壊闄や簡綺夌孩鑹層佺孩銆佺櫧銆侀粍浠ュ鏈夎澶氬彉鑹插搧縐嶏紝涔熸湁鏉傝壊鍝佺

鑺辨湡 鏄ユ湯鑷崇瀛?

鑺辮 緹庛佺埍銆佹亱錛?

鐜懓鏈韓浠h〃鐖辨儏錛岀櫧鑹茬殑浠h〃錛氭垜灝婃暚浣狅紱綰㈣壊鐨勪唬琛細(xì)鐑亱錛涚孩鐧芥販鍚堜唬琛細(xì)鍜岃В錛涢粍鑹茬殑浠h〃瀚夊

閲嶇偣 鎯呬漢鑺傞佽姳錛岀帿鐟版槸蹇呯劧涔嬮夛紝浣嗚娉ㄦ剰涓嶅悓棰滆壊浠h〃鐨勪笉鍚屾剰鎬濄?

鐜懓鑻辨枃鍚峳ose錛屾簮浜庡笇鑵婅rode錛岀孩鑹茬殑鎰忔濄傛硶鍥介潻鍛藉悗鏂扮敓鐨勮吹濡囦漢錛屾嬁鐮翠粦鐨勫瀛愮害鐟熻姮錛屽湪宸撮粠閮婂鐨勭帥灝?dāng)姊呴婂畢閭稿緩閫犱簡涓搴у畯浼熺殑鐜懓鍥紝騫跺懡浜哄埌嬈ф床鍙婁笘鐣屽悇鍦版悳闆嗙弽璐電殑鐜懓鍝佺錛涙嵁璇村湪濂圭殑鐜懓鍥噷縐嶆鐫涓変竾鏍帿鐟幫紝鑰屽ス鐨勮姳鍖犱篃鏄彶涓婄涓涓皾璇曚互浜哄伐鍩圭帿鐟拌姳縐嶇殑浜猴紝鎷滃ス涔嬭祼錛岀帿鐟拌繘鍏ヤ簡銆岃繎浠c嶃傜害鐟熻姮璇風(fēng)敾瀹墮瞾閬撶壒綰綍鐜懓鍥噷鐜懓鐨勫Э鎬侊紝浣嗘槸鏈強瀹屾垚錛岀編浜哄嵈宸查娑堢帀孌掋傚叾鍚庨瞾閬撶壒鐨勭敾浠ャ庣帿鐟板浘璋便忓嚭鐗堟垚鍐岋紝鍥犺岃幏寰椼庣帿鐟扮敾瀹躲忕殑緹庡悕銆傞瞾閬撶壒綰ょ粏銆佷紭闆呯敾椋庯紝浼間箮姘歌繙姝岄鐫鐨囧綰︾憻鑺湭瀹屾垚鐨勬ⅵ錛屾瓕棰?nbsp; 闃呰鍏ㄦ枃

ashura 2007-04-28 12:25 鍙戣〃璇勮
]]>
C錛嬶紜涓殑鏂囦歡杈撳叆杈撳嚭嫻?/title><link>http://www.shnenglu.com/ashura/archive/2007/04/28/23091.html</link><dc:creator>ashura</dc:creator><author>ashura</author><pubDate>Sat, 28 Apr 2007 03:51:00 GMT</pubDate><guid>http://www.shnenglu.com/ashura/archive/2007/04/28/23091.html</guid><wfw:comment>http://www.shnenglu.com/ashura/comments/23091.html</wfw:comment><comments>http://www.shnenglu.com/ashura/archive/2007/04/28/23091.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ashura/comments/commentRss/23091.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ashura/services/trackbacks/23091.html</trackback:ping><description><![CDATA[     鎽樿:   C++涓殑鏂囦歡杈撳叆/杈撳嚭(3) 鍘熶綔錛欼lia Yordanov,  loobian@cpp-home.com   鎺屾彙杈撳叆/杈撳嚭嫻?  鍦ㄨ繖涓绔犻噷錛屾垜浼?xì)鎻愬強涓浜涙湁鐢ㄧ殑鍑芥暟銆傛垜灝嗕負(fù)浣犳紨紺哄浣曟墦寮涓涓彲浠ュ悓鏃惰繘琛岃銆佸啓鎿嶄綔鐨勬枃浠訛紱姝ゅ錛屾垜榪樺皢涓轟綘浠嬬粛鍏跺畠鎵撳紑鏂囦歡鐨勬柟娉曪紝浠ュ強濡備綍鍒ゆ柇鎵撳紑鎿嶄綔鏄惁鎴愬姛銆傚洜姝わ紝璇鋒帴鐫寰涓嬭錛?鍒扮洰鍓嶄負(fù)姝紝鎴戝凡涓轟綘鎵...  <a href='http://www.shnenglu.com/ashura/archive/2007/04/28/23091.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/ashura/aggbug/23091.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ashura/" target="_blank">ashura</a> 2007-04-28 11:51 <a href="http://www.shnenglu.com/ashura/archive/2007/04/28/23091.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍩哄洜鑺墖錛昏祫鏂欐暣鐞嗭冀http://www.shnenglu.com/ashura/archive/2007/04/28/23086.htmlashuraashuraSat, 28 Apr 2007 03:10:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/28/23086.htmlhttp://www.shnenglu.com/ashura/comments/23086.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/28/23086.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/23086.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/23086.html 鐢熺墿鑺墖錛岀畝鍗曞湴璇村氨鏄湪涓鍧楁寚鐢插ぇ灝忥紙1cm3錛夌殑鏈夊鑱氳禆姘ㄩ吀鍖呰鐨勭鐗囦笂鎴栧叾瀹冨浐鐩告敮鎸佺墿錛堝鐜葷拑鐗囥佺鐗囥佽仛涓欑儻鑶溿佺閰哥氦緇寸礌鑶溿佸凹榫欒啘絳夛紝浣嗛渶緇忕壒孌婂鐞嗐備綔鍘熶綅鍚堟垚鐨勬敮鎸佺墿鍦ㄨ仛鍚堝弽搴斿墠瑕佸厛浣垮叾琛ㄩ潰琛嶇敓鍑虹緹鍩烘垨姘ㄥ熀錛堣鎵瑕佸浐瀹氱殑鍒嗗瓙涓烘牳閰告垨瀵¤偨鑰屽畾錛夊茍涓庝繚鎶ゅ熀寤虹珛鍏變環(huán)榪炴帴錛涗綔鐐規(guī)牱鐢ㄧ殑鏀寔鐗╀負(fù)浣垮叾琛ㄩ潰甯︿笂姝g數(shù)鑽蜂互鍚擱檮甯﹁礋鐢?shù)鑽风殑鎺㈤拡鍒嗗瓙锛岄氬父闇鍖呰浠ユ皚鍩虹鐑鋒垨澶氳仛璧栨皚閰哥瓑錛夊皢鐢熺墿鍒嗗瓙鎺㈤拡錛堝鏍歌嫹閰哥墖孌墊垨鍩哄洜鐗囨錛変互澶ц妯¢樀鍒楃殑褰㈠紡鎺掑竷錛屽艦鎴愬彲涓庣洰鐨勫垎瀛愶紙濡傚熀鍥狅級鐩鎬簰浣滅敤錛屼氦琛屽弽搴旂殑鍥虹浉琛ㄩ潰錛屽湪嬋鍏夌殑欏哄簭嬋鍙戜笅鏍囪鑽у厜鏍規(guī)嵁瀹為檯鍙嶅簲鎯呭喌鍒嗗埆鍛堢幇涓嶅悓鐨勮崸鍏夊彂灝勮氨寰侊紝CCD鐩告満鎴栨縺鍏夊叡鑱氱劍鏄懼井闀滄牴鎹叾娉㈤暱鍙婃嘗騫呯壒寰佹敹闆嗕俊鍙鳳紝浣滃嚭姣旇緝鍜屾嫻嬶紝浠庤岃繀閫熷緱鍑烘墍瑕佺殑淇℃伅銆傜敓鐗╄姱鐗囧寘鎷熀鍥犺姱鐗囥佽泲鐧借川鑺墖銆佺粍緇囪姱鐗囥傝屽熀鍥犺姱鐗囦腑錛屾渶鎴愬姛鐨勬槸DNA鑺墖錛屽嵆灝嗘棤鏁伴鍏堣璁″ソ鐨勫鏍歌嫹閰告垨cDNA鍦ㄨ姱鐗囦笂鍋氭垚鐐歸樀錛屼笌鏍峰搧涓悓婧愭牳閰稿垎瀛愭潅浜ょ殑鑺墖銆?nbsp; 闃呰鍏ㄦ枃

ashura 2007-04-28 11:10 鍙戣〃璇勮
]]>
C++鐨勪竴浜涘厤璐瑰簱http://www.shnenglu.com/ashura/archive/2007/04/24/22736.htmlashuraashuraTue, 24 Apr 2007 09:46:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/24/22736.htmlhttp://www.shnenglu.com/ashura/comments/22736.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/24/22736.html#Feedback2http://www.shnenglu.com/ashura/comments/commentRss/22736.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/22736.html
鍘熸枃錛欳++鐨勪竴浜涘厤璐瑰簱



//鏁寸悊 by RobinKin (鐜嬩寒)

  闃呰鍏ㄦ枃

ashura 2007-04-24 17:46 鍙戣〃璇勮
]]>
绱?/title><link>http://www.shnenglu.com/ashura/archive/2007/04/24/22734.html</link><dc:creator>ashura</dc:creator><author>ashura</author><pubDate>Tue, 24 Apr 2007 09:39:00 GMT</pubDate><guid>http://www.shnenglu.com/ashura/archive/2007/04/24/22734.html</guid><wfw:comment>http://www.shnenglu.com/ashura/comments/22734.html</wfw:comment><comments>http://www.shnenglu.com/ashura/archive/2007/04/24/22734.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ashura/comments/commentRss/22734.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ashura/services/trackbacks/22734.html</trackback:ping><description><![CDATA[鏈榪戝嚑澶╃湡鏄瘡<br>鐧藉ぉ澶勭悊鏁版嵁錛屾櫄涓婂啓紼嬪簭<br>浠婂ぉ鎵句簡涓悊鐢憋紝鍚冨畬鍗堥キ灝變粠瀹為獙瀹ゆ簻鍥炴潵浜?br>鍥炴潵鏈潵鎯崇戶緇啓紼嬪簭<br>鎹i紦浜嗕竴浼?br>鎾戜笉涓嬪幓<br>涓婂簥浜?br>韜轟簡涓涓灝忔椂錛屽眳鐒跺仛浜嗕笁涓ⅵ........濂囨殑姊?...<br><br>璁板緱姣旇緝娓呮鐨勪竴涓槸涓涓笉璁よ瘑鐨勫笀鍏勬嬁浜嗕竴鏈珻璇█×××榪欑被鐨勪功錛屽緢鏃э紝鍙垜鐪嬶紝鐒跺悗榪樼粰鎴戞紨紺轟簡涓涓鐞嗘暟鎹殑紼嬪簭<img src="http://www.shnenglu.com/CuteSoft_Client/CuteEditor/images/emcrook.gif" align=absMiddle border=0>鍚庢潵鎴戞帴浜嗕釜鐢?shù)璇濆Q屼粬灝變笉璁蹭簡..... <img src ="http://www.shnenglu.com/ashura/aggbug/22734.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ashura/" target="_blank">ashura</a> 2007-04-24 17:39 <a href="http://www.shnenglu.com/ashura/archive/2007/04/24/22734.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Gamehttp://www.shnenglu.com/ashura/archive/2007/04/20/22419.htmlashuraashuraFri, 20 Apr 2007 12:35:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/20/22419.htmlhttp://www.shnenglu.com/ashura/comments/22419.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/20/22419.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/22419.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/22419.html鏈榪戝嚑澶╁父鐪嬪埌甯堝鍦ㄧ帺涓涓皬娓告垙錛?br>浠婂ぉ“緙?#8221;鐫甯堝鏁欐垜鐜?br>鐪嬪緱鍑哄笀濮愪笉鏄珮鎵媈.^
涓嶈繃甯堝鑻辮澶熺墰
榪欐槸涓嬭澆鍦板潃
http://www.jollybear.com/bigcityadventuresf/index.html

======================
鍥炲鏍″悗灞呯劧鐜╄繖涓父鎴忓埌鍗佷簩鐐瑰



ashura 2007-04-20 20:35 鍙戣〃璇勮
]]>
鐖北http://www.shnenglu.com/ashura/archive/2007/04/20/22407.htmlashuraashuraFri, 20 Apr 2007 11:37:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/20/22407.htmlhttp://www.shnenglu.com/ashura/comments/22407.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/20/22407.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/22407.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/22407.html甯堝厔甯堝鐖北鍘諱簡
鍙垜涓璧峰幓
鎴戞病鍘?br>璺戝洖瀛︽牎coding浜員銆俆~~~~



ashura 2007-04-20 19:37 鍙戣〃璇勮
]]>
[杞琞濡備綍浣跨敤 <fstream> 綾昏繘琛屾枃浠剁殑 I/O 澶勭悊http://www.shnenglu.com/ashura/archive/2007/04/15/21970.htmlashuraashuraSun, 15 Apr 2007 13:26:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/15/21970.htmlhttp://www.shnenglu.com/ashura/comments/21970.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/15/21970.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/21970.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/21970.html濡備綍浣跨敤 <fstream> 綾昏繘琛屾枃浠剁殑 I/O 澶勭悊

浣滆咃細(xì)Danny Kalev
緙栬瘧錛歁TT 宸ヤ綔瀹?/p>

涓嬭澆婧愪唬鐮?/font>
鍘熸枃鍑哄錛?a target=_blank>How to Use <fstream> Classes for File I/O

鎽樿錛?/strong>浼犵粺鐨勬枃浠?I/O 搴撳 Unix 鐨?<io.h> 鍜?<stdio.h> 錛岀敱浜庡叾紼嬪簭鎺ュ彛鐨勫師鍥狅紝鍦ㄥ緢澶х▼搴︿笂寮哄埗紼嬪簭鍛樿繘琛屾煇浜涘鐞嗭紝緙轟箯綾誨瀷瀹夊叏鍜屽浗闄呭寲鏀寔銆侰++ 鐨?<fstream> 搴撳垯鍦ㄦ枃浠剁殑 I/O 鏂歸潰鎻愪緵浜嗕竴涓寮虹殑銆侀潰鍚戝璞$殑銆佸叿鏈夊浗闄呭寲鎰忚瘑鐨勫簱銆傛湰鏂囧皢浠嬬粛濡備綍浣跨敤榪欎釜搴撹繘琛屾枃浠剁殑 I/O 澶勭悊騫跺埄鐢ㄥ畠鏉ョ紪鍐欐槗浜庤法騫沖彴鐨勪唬鐮併?/td>


銆銆澶у鏁?C++ 紼嬪簭鍛橀兘鐔熸?zhèn)変笉姝竴涓枃浠?I/O 搴撱傞鍏堟槸浼犵粺鐨?Unix 椋庢牸鐨勫簱錛屽畠鐢變竴浜涗綆綰у嚱鏁板 read() 鍜?open()緇勬垚銆傚叾嬈℃槸 ANSI C 鐨?<stdio.h> 搴擄紝瀹冨寘鍚?fopen() 鍜?fread()絳夊嚱鏁般傚叾瀹冪殑榪樻湁涓浜涘叿澶囨墍鏈夋潈鐨勫簱鎴栨鏋訛紝姣斿 MFC錛屽畠鏈夊緢澶氳嚜宸辯殑鏂囦歡澶勭悊綾匯?br>銆銆榪欎簺搴撲竴鑸兘寰堥毦璺ㄥ鉤鍙頒嬌鐢ㄣ傛洿緋熺殑鏄紝涓婅堪鎻愬埌鐨?C 搴撶敱浜庡叾紼嬪簭鎺ュ彛鐨勫師鍥狅紝鍦ㄥ緢澶х▼搴︿笂寮哄埗紼嬪簭鍛樿繘琛屾煇浜涘鐞嗭紝鑰屼笖緙轟箯綾誨瀷瀹夊叏鏀寔銆?br>銆銆鏍囧噯 C++ 鎻愪緵鎻愪緵浜嗕竴涓寮虹殑銆侀潰鍚戝璞$殑銆佸叿鏈夊浗闄呭寲鎰忚瘑鐨?nbsp; <fstream> 搴撱傝繖涓簱鍖呭惈涓緋誨垪媧劇敓浜庢爣鍑?ios_base 鍜?ios 綾葷殑綾繪ā鏉褲傚洜姝わ紝 <fstream> 鎻愪緵浜嗛珮綰х殑鑷姩鎺у埗鏈哄埗鍜屽仴澹с傛湰鏂囦笅闈㈠皢紺鴻寖濡備綍浣跨敤  <fstream> 綾誨疄鐜版枃浠剁殑杈撳叆/杈撳嚭澶勭悊錛?br>
絎竴姝ワ細(xì)鍒涘緩鏂囦歡嫻?br>銆銆杈撳叆鏂囦歡嫻侊紙ifstream錛夋敮鎸侀噸杞界殑 >> 鎿嶄綔絎︼紝鍚屾牱錛岃緭鍑烘枃浠舵祦錛坥fstream錛夋敮鎸侀噸杞界殑 << 鎿嶄綔絎︺傜粨鍚堜簡杈撳叆鍜岃緭鍑虹殑鏂囦歡嫻佽縐頒負(fù) fstream銆備笅闈㈢殑紼嬪簭鍒涘緩浜嗕竴涓?ifstream 瀵硅薄錛歞ict錛屽茍灝嗚瀵硅薄涓殑姣忎竴涓崟瀛楁樉紺哄埌灞忓箷涓婏細(xì)

#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
int main()
{
string s;
cout<<"enter dictionary file: ";
cin>>s;
ifstream dict (s.c_str());
if (!dictionary) // were there any errors on opening?
exit(-1);
while (dictionary >> s) cout << s <<''\n'';
}      
銆銆鎴戜滑蹇呴』璋冪敤 string::c_str() 鎴愬憳鍑芥暟錛屽洜涓?fstream 瀵硅薄鍙帴鍙楀父閲忓瓧絎︿覆浣滀負(fù)鏂囦歡鍚嶃傚綋浣犲皢鏂囦歡鍚嶄綔涓哄弬鏁頒紶閫掓椂錛屾瀯閫犲嚱鏁拌瘯鍥炬墦寮鎸囧畾鐨勬枃浠躲傛帴鐫錛屾垜浠敤閲嶈澆鐨?錛佹搷浣滅鏉ユ鏌ユ枃浠剁殑鐘舵併傚鏋滃嚭閿欙紝璇ユ搷浣滅浼板間負(fù) true銆傛渶鍚庝竴琛屾槸涓驚鐜紝姣忔鍙嶅閮戒粠鏂囦歡璇誨彇涓涓崟瀛楋紝灝嗗畠鎷瘋礉鍒?s錛岀劧鍚庢樉紺哄嚭鏉ャ傛敞鎰忔垜浠笉蹇呮樉寮忓湴媯鏌?EOF錛屽洜涓洪噸杞芥搷浣滅 >> 浼?xì)鑷姩澶勭悊銆傛澶栵紝鎴戜滑涓嶇敤鏄懼紡鍦板叧闂鏂囦歡錛屽洜涓烘瀽鏋勫嚱鏁頒細(xì)涓烘垜浠仛榪欎歡浜嬫儏銆?br>銆銆榪囨椂鍜岃崚搴熺殑 <fstream.h> 搴撴敮鎸?ios::nocreate 鍜?ios::noreplace 鏍囧織銆備絾鏂扮殑 <fstream> 搴撳凡緇忓彇浠d簡 <fstream.h> 騫朵笉鍐嶆敮鎸佽繖涓や釜鏍囧織銆?br> 
鏂囦歡鐨勬墦寮妯″紡
銆銆濡傛灉浣犱笉鏄懼紡鎸囧畾鎵撳紑妯″紡錛宖stream 綾誨皢浣跨敤榛樿鍊箋備緥濡傦紝ifstream 榛樿浠ヨ鏂瑰紡鎵撳紑鏌愪釜鏂囦歡騫跺皢鏂囦歡鎸囬拡緗負(fù)鏂囦歡鐨勫紑濮嬪銆備負(fù)浜嗗悜鏌愪釜鏂囦歡鍐欏叆鏁版嵁錛屼綘闇瑕佸垱寤轟竴涓?ofstream 瀵硅薄銆?lt;fstream> 瀹氫箟浜嗕笅鍒楁墦寮妯″紡鍜屾枃浠跺睘鎬э細(xì)
ios::app // 浠庡悗闈㈡坊鍔?
ios::ate // 鎵撳紑騫舵壘鍒版枃浠跺熬
ios::binary // 浜岃繘鍒舵ā寮?I/O (涓庢枃鏈ā寮忕浉瀵?
ios::in // 鍙鎵撳紑
ios::out // 鍐欐墦寮
ios::trunc // 灝嗘枃浠舵埅涓?0 闀垮害

浣犲彲浠ョ敤浣嶅煙鎿嶄綔絎?OR 緇勫悎榪欎簺鏍囧織錛?/p>

ofstream logfile("login.dat", ios::binary | ios::app);

fstream 綾誨瀷瀵硅薄鍚屾椂鏀寔璇誨拰鍐欐搷浣滐細(xì)

fstream logfile("database.dat", ios::in | ios::out);

絎簩姝ワ細(xì)璁劇疆鏂囦歡鐨勪綅緗?br>銆銆鏂囦歡鍏峰涓涓昏緫鎸囬拡錛屽畠鎸囧悜璇ユ枃浠朵腑鐨勬煇涓亸縐諱綅緗備綘鍙互閫氳繃璋冪敤seekp()鎴愬憳鍑芥暟錛屼互瀛楄妭涓哄崟浣嶅皢榪欎釜鎸囬拡瀹氫綅鍒版枃浠剁殑浠繪剰浣嶇疆銆備負(fù)浜嗚幏鍙栦粠鏂囦歡寮濮嬪鍒板綋鍓嶅亸縐葷殑瀛楄妭鏁幫紝璋冪敤seekp()鍗沖彲銆傚湪涓嬮潰鐨勪緥瀛愪腑錛岀▼搴忓皢鏂囦歡浣嶇疆鍓嶇Щ10涓瓧鑺傦紝鐒跺悗璋冪敤 tellp()鎶ュ憡鏂頒綅緗細(xì)

ofstream fout("parts.txt");
fout.seekp(10); // 浠?鍋忕Щ寮濮嬪墠榪?10 涓瓧鑺?
cout<<"new position: "<<fout.tellp(); // 鏄劇ず 10

浣犲彲浠ョ敤涓嬮潰鐨勫父閲忛噸鏂板畾浣嶆枃ian鎸囬拡錛?

ios::beg // 鏂囦歡寮濮嬩綅緗?
ios::cur // 褰撳墠浣嶇疆錛屼緥濡? ios::cur+5
ios::end // 鏂囦歡灝?/pre>

絎笁姝ワ細(xì)璇誨啓鏁版嵁
銆銆fstream 綾諱負(fù)鎵鏈夊唴寤烘暟鎹被鍨嬩互鍙?std::string 鍜?std::complex 綾誨瀷閲嶈澆 << 鍜?>> 鎿嶄綔絎︺備笅闈㈢殑渚嬪瓙紺鴻寖浜嗚繖浜涙搷浣滅鐨勪嬌鐢ㄦ柟娉曪細(xì)

fstream logfile("log.dat");
logfile<<time(0)<<"danny"<<''\n''; // 鍐欎竴鏉℃柊璁板綍
logfile.seekp(ios::beg); // 浣嶇疆閲嶇疆
logfile>>login>>user; // 璇誨彇浠ュ墠鍐欏叆鐨勫?/pre>


浣滆呯畝浠?/strong>
銆銆Danny Kalev 鏄竴鍚嶉氳繃璁よ瘉鐨勭郴緇熷垎鏋愬笀鍜岃蔣浠跺伐紼嬪笀錛屼笓鏀?C++ 鍜屽艦寮忚璦鐞嗚銆?997 騫村埌 2000 騫存湡闂達(dá)紝浠栨槸 C++ 鏍囧噯濮斿憳浼?xì)鎴愬憳銆傛渶榪戜粬浠ヤ紭寮傛垚緇╁畬鎴愪簡浠栧湪鏅氳璦瀛︾爺絀舵柟闈㈢殑紜曞+璁烘枃銆?涓氫綑鏃墮棿浠栧枩嬈㈠惉鍙ゅ吀闊充箰錛岄槄璇葷淮澶氬埄浜氭椂鏈熺殑鏂囧浣滃搧錛岀爺絀?Hittite銆丅asque 鍜?Irish Gaelic 榪欐牱鐨勮嚜鐒惰璦銆傚叾瀹冨叴瓚e寘鎷冨彜鍜屽湴鐞嗐侱anny 鏃跺父鍒頒竴浜?C++ 璁哄潧騫跺畾鏈熶負(fù)涓嶅悓鐨?C++ 緗戠珯鍜屾潅蹇楁挵鍐欐枃绔犮備粬榪樺湪鏁欒偛鏈烘瀯璁叉巿紼嬪簭璁捐璇█鍜屽簲鐢ㄨ璦璇劇▼銆?br>



ashura 2007-04-15 21:26 鍙戣〃璇勮
]]>[杞澆]VC++甯歌閿欒http://www.shnenglu.com/ashura/archive/2007/04/15/21969.htmlashuraashuraSun, 15 Apr 2007 13:24:00 GMThttp://www.shnenglu.com/ashura/archive/2007/04/15/21969.htmlhttp://www.shnenglu.com/ashura/comments/21969.htmlhttp://www.shnenglu.com/ashura/archive/2007/04/15/21969.html#Feedback0http://www.shnenglu.com/ashura/comments/commentRss/21969.htmlhttp://www.shnenglu.com/ashura/services/trackbacks/21969.htmlVisual C++ Error Messages

This page contains a listing of "difficult to diagnose" error messages and possible fixes. I haven't taught a programming class that uses Visual C++ in several years so this list is probably out of date by now.  It was valid for Microsoft Visual C++ version 6.0 service pack 3.

 

C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information

This error results from leaving off the parentheses immediately following the function name in a function header.  To correct the error simply add () to the end of the function name.

 

C1010: unexpected end of file while looking for precompiled header directive

If your project is an MFC AppWizard created project then this error results from not #including StdAfx.h as the first 錛?span lang=EN-US>include statement (before any other 錛?span lang=EN-US>includes, data declarations, or executable program code).

 

C1083: Cannot open precompiled header file: 'Debug/<Project-Name>.pch': No such file or directory

This error results from a missing file - the compiled version of StdAfx.cpp. Visual C++ does a poor job of keeping track of this file and frequently "forgets" how to build it. This problem often occurs after restoring a saved workspace from diskette without the Debug directory. To fix the error select StdAfx.cpp from the workspace file list them choose Compile from the Build menu.  If that doesn't work the go to Project -> Settings, select the C/C++ tab, and click the radio button labeled Create Precompiled Headers.

 

C2001: newline in constant

This error is usually caused by a string or character constant that is missing its closing ' or " symbol.

C2065: '<data-member name>' : undeclared identifier

If this error occurs in one of your member functions then it is generally the result of forgetting the class scope operator in front of the function name in your .cpp file.

 

C2143: syntax error : missing ';' before 'PCH creation point'

Check each of the 錛?span lang=EN-US>include files to ensure that the closing brace of each class declaration is followed by a semicolon.

 


C2143: syntax error : missing ';' before '*'

If this error is followed by two C2501 errors then the problem is an undeclared class name within a pointer declaration.

For example, the declaration:

CClass *pObject;

will generate the above error message followed by a C2501 error message for 'CClass' and another C2501 message for 'pObject'.  The problem is that the compiler isn't recognizing CClass as a valid class/type name.  To correct the problem add a 錛?span lang=EN-US>i nclude of the file containing the declaration of CClass (e.g., 錛?span lang=EN-US>i nclude CClass.h)

 

C2447: missing function header (old-style formal list?)

This error usually results from a missing { or use of a ; instead of a { following the parameter list of a function header.

 

C2511: '<function-name>' : overloaded member function not found in '<class-name>'

This error results from a mismatch in the parameter list of a member function declaration (.h file) and definition (.ccp file). Check the forward declaration of the function in the .h file and its definition in the .cpp file and ensure that the number of parameters and the type of each parameter match exactly.

C2512: '<constructor-function-name>' : no appropriate default constructor available

This error usually occurs when you implement the constructor function of a derived class and forget to include parameter passing to the base class constructor function.   For example assume that CDerived is derived from CBase and that the CBase constructor function requires one parameter (e.g., int A).  If you define the CDerived constructor function as:

CDerived::CDerived(int A, int B) { ... }

the compiler will issue the above error message on the line containing the function header of CDerived::CDerived() because you haven't provided instructions for routing the parameter A to CBase::CBase().  Because you didn't provide instructions the compiler assumes that CBase::CBase() requires no arguments and it complains because no version of CBase::CBase() has been defined that accepts zero arguments.

If you intended to provide a version of CBase::CBase() that requires no arguments then the error message indicates that you forgot to declare that function in your base class declaration (e.g., in CBase.h).

If CBase::CBase() does require one or more arguments then you must correct the problem by including explicit instructions for passing parameters from the derived class constructor function to the base class constructor function.  The correction for the example above is:

CDerived::CDerived(int A, int B) : CBase(A) { ... }

 

C2556: '<function-name>' : overloaded functions only differ by return type
C2371: '<function-name>' : redefinition; different basic types

These errors usually result from a mismatch of function type between a .h and .cpp file. Check the forward declaration of the function in the .h file and its definition in the .cpp file and make the function return type identical in both files.

 

C2601: '<function-name>' : local function definitions are illegal

This error results from defining one function inside the body of another function.   It usually means that you omitted one or more } symbols in the function just before the function named in the error message.

C2653: '<Class-Name>' : is not a class or namespace name

This error usually results from not having 錛?span lang=EN-US>include "StdAfx.h" as the first 錛?span lang=EN-US>include statement in your class.cpp file.  It can also occur if your class definition is in a .h file and you forget to 錛?span lang=EN-US>include that .h file in another file that refers to the class name.

 

C2661: '<Class-Name>::<Function-Name>' : no overloaded function takes n parameters

This error indicates a mismatch between the parameters used in a function call (e.g., from main.cpp) and the declaration of the function.  The function call is passing n parameters and there is no function declaration that uses that number of parameters.

 

LNK1104: Cannot open file nafxcwd.lib

This error sometimes occurs when a project uses a class from the MFC but the project settings don't explicitly tell the link editor to look in the MFC libraries. 

Go to Project --> Settings (Build --> Settings in Visual C++ 4.0). On the General tab check the box that says "Use MFC in a Shared DLL".

 

LNK1168: cannot open Debug\<Project-Name>.exe for writing

This error occurs when the link editor attempts to write to a .exe file that is currently in use. The .exe file of an executing program is write protected until the program is terminated. Look at the status bar at the bottom of your screen and find the icon representing your executable application. Open the application and exit from it. Then select Build.

 

LNK2001: unresolved external symbol __endthreadex
LNK2001: unresolved external symbol __beginthreadex

These errors result from using an MFC object or function without telling the link editor to search the MFC libraries.

Go to Project --> Settings (Build --> Settings in Visual C++ 4.0). On the General tab check the box that says "Use MFC in a Shared DLL".

LNK2001: unresolved external symbol _main

Your project doesn't contain a function called main().  The error usually results from forgeting to add main.cpp to the project workspace.

 

<File>.obj : error LNK2001: unresolved external symbol "public: void __thiscall <Class1>::<Function1>(<Type>)"

This a generic form of a LNK2001 error where <File>.obj can be any object file in your project and <Class1>::<Function1>(<Type>) can be any function in any class.  Substitute the specific <File>, <Class>, <Function>, and <Type> in your message into the instructions below to diagnose and correct the problem.

An LNK2001 error means that the link editor is looking for a compiled function and can't find it.  The call to the "missing function" is somewhere in <File>.cpp. Unfortunately, double-clicking on the error message won't take you to the point in <File.cpp> where the function is called but you can search for it with Find or Find In Files.  The function the link editor can't find is a member of <Class>, its name is <Function1>, and its return type is <Type>.

There are two common reasons for a LNK2001 error:

1.        The call in <File>.cpp doesn't match the function prototype in <Class>.h and/or the implementation in <Class>.cpp.  The mismatch may be in the function name, return type, or number and/or type of parameters.   Correction strategies include:

o        Check that the function name is spelled the same (case sensitive) in all three files (File.cpp, Class.h, and Class.cpp).

o        Check that the function is actually declared and defined within <Class> - perhaps you defined it as a member of a different class or perhaps you tried to call the function (in <File>.cpp) using an object or object pointer of a different class.

o        Check that the number and type of parameters in the function implementation (in <Class>.cpp) matches the number and type of parameters declared in the function declaration in <Class>.h.

o        Check that the number and type of parameters in the function call (in <File>.cpp) matches the number and type of parameters declared in the function header in <Class>.cpp.

2.        The function was never declared or was declared but never defined.  To see if either is the case go to the ClassView window of the Workspace view.  Click the + next to <Class> and find <Function> in the list of member functions.

o        If <Function> is NOT in the list then it was never declared or defined - add a declaration to the class declaraion in <Class>.h and implement the function in <Class>.cpp.

If <Function> is in the list then right click on it and select Go To Definition from the pop-up menu.  If you get the error message Cannot find definition (implementation) of this function then the function was declared but never defined (implemented).  Implement the function to

o        <Class>.cpp.

 

LNK2005: <some-long-string-of-mostly-garbage> already defined in <name>.lib(<name>.obj)

This error usually results from including a source code file multiple times. If you recognize any of the names in the message then it probably results from multiple inclusion of one of your own header files. Check to be sure that you've used #ifndef/#define/#endif properly your header files. If you don't recognize the name then it's probably multiple inclusion of a system file (e.g., afxwin.h). Make sure that you haven't explicitly included something in main.cpp that is already included in one of your own header files.   Also check that you haven't 錛?/span>included a .cpp file where you should have 錛?/span>included a .h file



ashura 2007-04-15 21:24 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              艳女tv在线观看国产一区| 亚洲日本成人| 欧美黄色大片网站| 久久激情五月激情| 欧美手机在线视频| 最新亚洲视频| 精品99一区二区| 午夜精品福利视频| 亚洲欧美精品suv| 欧美日韩国产一区二区三区地区| 美女尤物久久精品| 韩日精品视频| 欧美一区二区在线免费观看| 午夜日韩在线| 国产精品毛片a∨一区二区三区|国| 亚洲国产精品一区二区www在线 | 日韩视频在线免费| 久久夜色精品国产| 欧美成人黄色小视频| 亚洲第一伊人| 久久综合狠狠综合久久综青草| 久久久久久亚洲综合影院红桃| 国产欧美精品在线播放| 亚洲尤物视频在线| 久久精品国产亚洲一区二区| 国产伦精品一区二区三区高清| 在线视频一区二区| 亚洲欧美久久| 国产精品亚洲综合一区在线观看| 亚洲视频在线免费观看| 亚洲天堂黄色| 国产欧美一区二区三区另类精品| 亚洲午夜精品一区二区三区他趣 | 91久久久久| 欧美黄污视频| 一本色道久久88综合亚洲精品ⅰ| 亚洲性av在线| 国产亚洲欧美日韩美女| 久久久99精品免费观看不卡| 免费成人高清视频| 亚洲免费观看| 国产精品日韩高清| 久久不射2019中文字幕| 欧美大尺度在线观看| 亚洲三级电影全部在线观看高清| 欧美激情一区在线观看| 一区二区久久久久| 久久久免费精品视频| 最近中文字幕日韩精品| 国产精品超碰97尤物18| 午夜精品美女自拍福到在线| 免费亚洲网站| 一区二区三区精品视频在线观看| 国产精品美女一区二区| 久久精品噜噜噜成人av农村| 亚洲春色另类小说| 亚洲一区二区免费| 一区二区视频在线观看| 欧美日韩精品二区| 久久精品国产99| av成人国产| 快播亚洲色图| 亚洲尤物视频在线| 尤物精品在线| 国产精品高清网站| 蜜桃av一区二区| 亚洲性图久久| 亚洲国产综合视频在线观看| 性欧美精品高清| 亚洲美女诱惑| 一区二区在线免费观看| 欧美日韩中国免费专区在线看| 久久国产精品72免费观看| 99在线视频精品| 欧美激情一区二区| 久久蜜桃av一区精品变态类天堂| 日韩一级片网址| 亚洲国产精品成人精品| 亚洲精品免费看| 亚洲经典自拍| 国产精品区一区| 欧美精品国产一区| 久久国产精品电影| 亚洲图片激情小说| 亚洲国产高清高潮精品美女| 久久激情网站| 亚洲欧美日韩成人高清在线一区| 亚洲国产综合视频在线观看| 国产精品呻吟| 国产精品不卡在线| 欧美日韩p片| 欧美成人精品福利| 久久一区二区视频| 在线日韩日本国产亚洲| 国产精品一区二区久久国产| 老司机免费视频久久| 亚洲欧洲午夜| 狠狠色狠色综合曰曰| 国产美女精品| 国产精品入口尤物| 国产精品美女久久久| 欧美视频在线观看免费网址| 欧美日韩精品国产| 欧美精品在线视频观看| 欧美国产日本| 欧美日韩大片| 欧美精品色一区二区三区| 欧美国产欧美综合| 欧美激情亚洲视频| 欧美日本网站| 欧美无乱码久久久免费午夜一区 | 在线视频中文亚洲| 一本久久综合亚洲鲁鲁| 中国亚洲黄色| 亚洲午夜在线| 午夜精品免费视频| 久久久www免费人成黑人精品| 久久久精品日韩欧美| 久久―日本道色综合久久| 毛片一区二区三区| 欧美激情在线狂野欧美精品| 欧美区在线观看| 国产精品高清免费在线观看| 国产精品每日更新| 国产日产精品一区二区三区四区的观看方式 | 亚洲一区二区精品在线观看| 亚洲一区二区三区777| 亚洲欧美另类在线观看| 久久xxxx| 欧美96在线丨欧| 欧美日韩综合久久| 国产性天天综合网| 亚洲日本aⅴ片在线观看香蕉| 亚洲三级色网| 欧美一区91| 欧美二区在线观看| 一区二区三区精品视频| 欧美一区二区在线免费播放| 美女国产一区| 国产精品欧美日韩久久| **性色生活片久久毛片| 亚洲一区高清| 久久亚洲色图| 一区二区三区成人| 久久久一区二区三区| 欧美日韩一区二区三区四区在线观看| 国产免费成人av| 99精品视频免费观看| 欧美在线影院在线视频| 91久久极品少妇xxxxⅹ软件| 午夜精品区一区二区三| 欧美破处大片在线视频| 韩国一区二区三区在线观看| 亚洲手机视频| 嫩草影视亚洲| 亚洲摸下面视频| 欧美成人在线免费观看| 国产日韩欧美中文在线播放| 一本大道久久a久久精品综合| 久久久精品视频成人| 99热这里只有成人精品国产| 久久九九99视频| 国产精品丝袜xxxxxxx| 夜夜爽99久久国产综合精品女不卡| 久久久久久久久一区二区| 一本色道久久综合狠狠躁篇怎么玩 | 欧美一区二区三区男人的天堂 | 国产一区二区三区免费在线观看| 日韩写真在线| 欧美大尺度在线| 久久精品久久综合| 国产日韩欧美精品在线| 亚洲视频免费在线观看| 亚洲电影免费观看高清| 久久精品国产欧美激情| 国产乱码精品1区2区3区| 亚洲视频免费在线观看| 亚洲日本激情| 久久综合久久综合这里只有精品 | 久久久水蜜桃| 午夜欧美大片免费观看| 国产精品jvid在线观看蜜臀| 日韩视频不卡中文| 亚洲国产成人一区| 男同欧美伦乱| 亚洲日本aⅴ片在线观看香蕉| 毛片基地黄久久久久久天堂| 欧美一区二区黄| 国产亚洲欧洲| 久久九九免费视频| 久久精品av麻豆的观看方式| 国产主播一区| 久久乐国产精品| 久久久久久精| 亚洲黄色av| 亚洲日本中文字幕| 欧美日韩综合视频| 欧美一区二区日韩| 欧美一区二区三区四区视频| 激情视频亚洲|