第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

VC++6.0下關(guān)于file.getline()的一個(gè)死循環(huán)。

VC++6.0下關(guān)于file.getline()的一個(gè)死循環(huán)。

C++
未來(lái)的開拓者 2017-04-24 13:14:28
代碼如下://vc++6.0下運(yùn)行。#include <iostream>#include <fstream>#include <stdlib.h>using namespace std;void main(){??? char ch;????????char sten[81]; ????fstream infile;????infile.open("File.txt",ios::in); ????if(infile.fail()){ cout<<"infile error!"; exit(1); } ????fstream outfile("TextFile.txt",ios::out|ios::in);????if(outfile.fail()){ cout<<"outfile error!"; exit(2); } ????while(!infile.eof()){ ? //把File中的小寫字母變?yōu)榇髮懀瑢懭隩extFile。????????? infile.get(ch); ch=toupper(ch); outfile<<ch; ??? } ??????????????? infile.close();??? outfile.flush(); outfile.clear(); ??? outfile.seekg(0,ios::beg); ??? outfile.seekp(0,ios::beg); ??? int i=1;??? while(!outfile.eof()&&i<10){ ?//顯示TestFile的內(nèi)容,無(wú)i時(shí)會(huì)死循環(huán) ??????? outfile.getline(sten,81);????????cout<<i<<sten<<endl;??????? i++;??? } ??? outfile.close();}/*文件File.txt:When Day Is DoneIf the day is done ,If birds sing no more .If the wind has fiagged tired ,Then draw the veil of darkness thick upon me ,Even as thou hast wrapt the earth with The coverlet of sleep and tenderly closed ,The petals of the drooping lotus at dusk.From the traverer,Whose sack of provisions is empty before the voyage is ended ,Whose garment is torn and dust-laden ,Whose strength is exhausted,remove shame and poverty ,And renew his life like a flower underThe cover of thy kindly night .運(yùn)行后:TextFile.txt:WHEN DAY IS DONEIF THE DAY IS DONE ,IF BIRDS SING NO MORE .IF THE WIND HAS FIAGGED TIRED ,THEN DRAW THE VEIL OF DARKNESS THICK UPON ME ,EVEN AS THOU HAST WRAPT THE EARTH WITH THE COVERLET OF SLEEP AND TENDERLY CLOSED ,THE PETALS OF THE DROOPING LOTUS AT DUSK.FROM THE TRAVERER,WHOSE SACK OF PROVISIONS IS EMPTY BEFORE THE VOYAGE IS ENDED ,WHOSE GARMENT IS TORN AND DUST-LADEN ,WHOSE STRENGTH IS EXHAUSTED,REMOVE SHAME AND POVERTY ,AND RENEW HIS LIFE LIKE A FLOWER UNDERTHE COVER OF THY KINDLY NIGHT ..*/
查看完整描述

目前暫無(wú)任何回答

  • 0 回答
  • 0 關(guān)注
  • 1641 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)