2012-03-04 46 views
-4

被困在這一段時間,我有一個16行和3列的.dat文件。從文件加載數據到一個數組

例如:安德魯9月12日

我需要存儲的玩家,玩家數量的名稱,並評定爲點如上圖所示。

C++ btw。

+5

你可以發佈你到目前爲止的代碼嗎?如果它是'C++',爲什麼'c#'標籤? – hmjd 2012-03-04 22:05:08

回答

0

//包括fstream的和字符串

您的常規ifstream的將竭誠爲您服務好。

string playerName; 
int playerScore; 
int playerPoints; 

openedInFile>>playerName>>playerScore>>playerPoints; 
// loop for next row 

存儲爲合適。