【初心者歓迎】C/C++室 Ver.33【環境依存OK】
■ このスレッドは過去ログ倉庫に格納されています
0595デフォルトの名無しさん
2006/12/25(月) 23:12:27直すのめんどいからとりあえず動くようにだけしとく
fin.eof()のポイントはタイミング
--- 3276.txt.orig2006-12-25 22:54:51.000000000 +0900
+++ 3276.txt2006-12-25 23:07:06.000000000 +0900
@@ -2,6 +2,7 @@
#include <string>
#include <fstream>/* ファイルの入出力 */
#include <conio.h>/* getch */
+#include <sstream>
using namespace std;
#include "Class_Club.h"
enum enTableItem { Rank, Name, Game, Win, Draw, Lose, ForGoal, AgainstGoal, DiffGoal, WinPoint ,Inbalid };
@@ -92,9 +93,11 @@
}
/* ファイルの末尾まで繰り返し */
-while ( !fin.eof() )
+string linebuf;
+while ( getline (fin, linebuf) )
{
strInLineBuf = cInLineBuf;
+istringstream fin (linebuf);
/* 1行単位で、順位,チーム名,試合数,・・・を抽出 */
for ( iItemCnt = 0 ; iItemCnt < Inbalid ; iItemCnt++ )
■ このスレッドは過去ログ倉庫に格納されています