I'm trying to read data from a file using dynamic arrays, everything is great now except for one thing:
if I have a file with lets say 20 students' IDs and their scores
before starting the reading proccess, I did this:
string *studentID;
double *testScore;
cout<<"Enter number of student: ";
cin>>numberOfStudents;
cout<<endl;
studentID=new string[numberOfStudents];
testScore=new double[numberOfStudents];
which is illogical, the program must now the number of students based on the number o students' IDs saved in the infile.
can this be done without letting the user enter it?
thank you in advanced, and I hope I'm not breaking any rules.