Read data from file and store into an array of structs

后端 未结 2 1953
说谎
说谎 2021-01-24 20:58

So I need help creating a program that will open a file and read the data from the file into an array of structs and then calculate a variety of things like highest, lowest, ave

2条回答
  •  感情败类
    2021-01-24 21:07

    This should read all your data into the array, you'll want an incrementor to

    ifstream inStream; inStream.open("scores.txt");

     while (!inStream.eof())
     {
    
           inStream >> StudentData arr[SIZE];
    
     };
     inStream.close();
    

提交回复
热议问题