I'm trying create a C++ program to read the text file and tokenize each field of the text. So far I have this but I have an error that says "Variable length array of non-POD element type 'Employee'" Not sure what to do so I attempted to follow what I read and commented it below the error line but that created more errors.
int main () {
string line1, line2;
int i = 1, j=0;
int numberOfRecords = 0;
ifstream myInputFile ("emp.txt");
ofstream myOutputFileSort1, myOutputFileSort2;
myOutputFileSort1.open("emp3sort1.txt");
myOutputFileSort2.open("emp3sort2.txt");
if(myInputFile.is_open())
{
while(getline (myInputFile,line1))
{
numberOfRecords++;
}
myInputFile.close();
}
**Employee myEmployees [numberOfRecords];**//Variable length array of non-POD element type 'Employee'
//string *myEmployees = new string [numberOfRecords];//attempt to fix
ifstream myInputFileAgain ("emp.txt");
...