掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ファイルの出入力 (ID:58982)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
WIN XP Visual studio 今ファイルの入力をしてるんですが、うまい事いきません。 もしコードが間違っているなら助言お願いします。 void movieShop::getFile(){ char *infileName = "list.txt"; char *outfileName ="list.txt"; char ch; MovieItem *tempITEM; ifstream inRenList; ofstream outRecList; //Read all records from the text file //File open error inRenList.open(infileName, ios::in); if(!inRenList.is_open()){ cerr << "\nInput file" << infileName << " does not exist\n" << endl; cerr << "Please check your file.\n" << endl; exit(1); } while ((ch=inRenList.peek())!=EOF){ /*long num=0; char name[50]; bool check=true; int rate=0;*/ tempITEM->callNo= 0; strcpy(tempITEM->title, " "); tempITEM->status = true; tempITEM->frequency = 0; //cin.getline(ITEM,sizeof(ITEM)); inRenList >> tempITEM->callNo >> tempITEM->title >> tempITEM->status >> tempITEM->frequency; _insert(tempITEM,tempITEM->callNo,tempITEM->title,tempITEM->status,tempITEM->frequency ); }//while inRenList.close(); }
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.