so im trying to replace a back up file with the main file and vice versa
im not sure if CopyFile("F:\\iofile.txt", "F:\\ARCHIVE.txt", TRUE );
is correct or if i need to open the either file first.
the rest of the 2000 lines of my code is working flawlessly, im just stuck on the syntax for this part.
thanks
void TESTINGFIELD()
{
/*system("CLS");
cout << "TESTING FIELD EMPTY";*/
int yesNo = 0;
system("CLS");
cout << "you have selected to replace the main file with the back up" << endl
<< "press 'y' to continue or any other key to cancel ";
yesNo = getch();
switch( yesNo )
{
case'y':
case'Y':
system("CLS");
yesNo = 0;
cout << "you have selected to continue" << endl << endl
<< "\a#################################" << endl
<< "## !! WARNING !! ##" << endl
<< "#################################" << endl << endl;
pause(1);
cout << "\a################################" << endl
<< "## this can not be undone! ##" << endl
<< "################################" << endl << endl << endl
<< " are you sure you want to replace the main file with the back up ? " << endl
<< " press y to contine or any other key to cancel " << endl << endl;
yesNo = getch();
switch( yesNo )
{
case'y':
case'Y':
cout << "you have now replaced the main file with the back up " << endl << endl;
CopyFile("F:\\iofile.txt", "F:\\ARCHIVE.txt", TRUE );
break;
default:
pause(1);
cout << endl << endl << "you have cancled";
}
break;
default:
pause(1);
cout << endl << endl << "you have cancled";
}
MyFile.close();
}