我试图通过从文件中读取对象来实例化一个对象数组(跑步者)。有六个不同的变量可以描述每个人。我试图弄清楚如何创建一个数组,将这些跑步者的所有相同值存储在同一个元素中,同时保持每个跑步者的各个部分。
该文件如下所示:
{1,Gebre Gebremariam,2:08:00,,Ethiopia,ETH
2,Emmanuel Mutai,2:06:28,,Kenya,KEN
3,Geoffrey Mutai,2:05:06,,Kenya,KEN
4,Tsegaye Kebede,2:07:14,,Ethiopia,ETH
6,Jaouad Gharib,2:08:26,,Morocco,MAR
7,Meb Keflezighi,2:09:13,CA,United States,USA
8,Mathew Kisorio,2:10:58,,Kenya,KEN
10,Viktor Rothlin,2:12:26,,Switzerland,SUI
11,Bobby Curtis,2:16:44,PA,United States,USA
12,Ed Moran,2:11:47,VA,United States,USA
14,Abdellah Falil,2:10:35,,Morocco,MAR
15,Juan Luis Barrios,2:14:10,,Mexico,MEX
18,Stephen Muzhingi,2:29:10,,Zimbabwe,ZIM}