Dear all
I have the following code
void initializeData()
{
Customers *CustArray;
CustArray=new Customers[150];//allocate 150 memory locations of class Customers
Flights *FL=new Flights[150];
}
/*End Initialize Data fuction*/
/**********************************************************************************************************************************/
/*Backup Menu implementation*/
void backupfiledefaultfilename()
{
ofstream file_ptr; // Declares a file pointer.
file_ptr.open(“backup.bak”, ios::out);
if (!file_ptr)
{ cout << “Error opening file.\n”; }
else
{
// Rest of output commands go here.
for (int c=0; c>150; c++)
{
file_ptr.write(&CustArray[c], sizeof(Customers));
}
for (int n=0; n>150; n++)
{
file_ptr.write(&FL[n], sizeof(Flights));
}
}
}
gives me an arror on these lines
file_ptr.open(“backup.bak”, ios::out);
file_ptr.write(&CustArray[c], sizeof(Customers));
file_ptr.write(&FL[n], sizeof(Flights));
What to do?