相关代码 |
|
/*2-3.C*/ #include #include int delete_file(char near *filename) { union REGS regs; int ret; regs.h.ah=0x41; regs.x.dx=(unsigned)filename; ret=intdos(®s,®s); return(regs.x.cflag?ret:0); } int main(void) { char near *filename; int err; printf("Enter filename:"); gets(filename); err=delete_file(filename); if(!err) printf("Able to delete",filename); else printf("NOT able to delete,this file not exist\n"); return 0; }