void write_records(SalesRecordPtr head, int n) // Save records to file
{ char outfilename[MAX_FILE_NAME + 1]; // Name of file for output records
ofstream out; // Output file stream
cout << "\n\nI need the output file name." << endl;
open_output(out, outfilename); // Get file name & open file
if (out.good())
{ out << n << endl;
int i;
for(i = 0; i < n; i++)
{ head[i].write(out);
}
out.close();
}
else
{ cout << "\a\nUnable to save data!" << endl;
}
<--- this is the dynamic array version of it need to change it to an linked list