Any help would be appreciated with this program :
I have a file with 5 lines....each line has name, id , phone ...etc...
I have to read that intro an array of structures and display the results.
This is what I have so far .. I doesn't not display anything
#include <iostream>
#include <fstream>
#include <string>
#include<iomanip>
using namespace std;
struct StudentInfo
{
string name;
int account_id, phone;
float checking, saving;
};
int main ()
{
ofstream file1;
const int MaxSize = 5;
StudentInfo myarray[MaxSize];
file1.open ("users.txt");
for (int i=0; i<MaxSize; ++i)
{
file1<<myarray[i].name;
file1<<myarray[i].account_id;
file1<<myarray[i].saving;
file1<<myarray[i].checking;
file1<<myarray[i].phone<<endl<<endl;
}
// }
return 0;
}