زبان : C -برنامه ای که نام فایلی را به عنوان آرماگون پذیرفته و آن را حذف می کند
#include
#include
#include
#include
int main(int argc, char *argv[])
{
char ans;
clrscr();
if(argc != 2) {
printf(" you must type a file name!\n") ;
getch();
exit(1) ;
} //end of if
printf(" erase %s (y/n):", argv[1]);
ans = getch();
if(toupper(ans) == 'Y')
if(remove(argv[1]))
printf("\n can not erase file %s.", argv[1]);
else
printf("\n file successfully erased.");
getch();
return 0;
}
+ نوشته شده در سه شنبه دهم اردیبهشت ۱۳۸۷ ساعت 10:8 توسط behzad lotfi
|