C
Colum
Hi,
I am trying to write data out to a file on floppy disk,
If the disk is present in the drive the program runs fine and outputs the
data correctly, however if the disk is not present in the drive, the program
enters the while loop which asks user to insert the disk and continuously
tries to open it, after the user has inserted the disk the program seems to
run fine, however there is no data in the output file.I think it could be a
problem with close() (not having a handle to the file) not opperating
properly, some code used:-
outFile.open(out,ios:ut);
while(!outFile.is_open())
{
cout<<"Please insert disk into A: drive and press key"<<endl;
getch();
outFile.open(out,ios:ut);
}
I am trying to write data out to a file on floppy disk,
If the disk is present in the drive the program runs fine and outputs the
data correctly, however if the disk is not present in the drive, the program
enters the while loop which asks user to insert the disk and continuously
tries to open it, after the user has inserted the disk the program seems to
run fine, however there is no data in the output file.I think it could be a
problem with close() (not having a handle to the file) not opperating
properly, some code used:-
outFile.open(out,ios:ut);
while(!outFile.is_open())
{
cout<<"Please insert disk into A: drive and press key"<<endl;
getch();
outFile.open(out,ios:ut);
}