#include
"iostream.h"
#include
"dos.h"
main()
{
//AIM :
to delete a file using dos call in all
the memory models
union REGS i,o;
struct SREGS s;
char far(fname[12]);
cout<<"Enter file name to be
deleted : ";
cin>>fname;
i.h.ah=0x41; //service no.
s.ds=FP_SEG(fname); //segment part of
the file name
i.x.dx=(unsigned int)FP_OFF(fname);//
offset part of the file name
intdosx(&i,&o,&s);
if (o.x.cflag==0)
cout<<" \nfile
"<<fname<<" deleted\n";
else
cout<<" \nfile "<<fname<<"
could not be deleted\n";
return 0;
}