早教吧作业答案频道 -->其他-->
英语翻译#include#include#include#include#include#include#includevoidvdel(void);voiddelaction(void);charsearchstr[MAXPATH],drive[MAXDRIVE],subdir[MAXDIR],pathname[MAXPATH],file[MAXFILE],ext[MAXEXT],name[MAXPATH];intdone,answer;structff
题目详情
英语翻译
#include
#include
#include
#include
#include
#include
#include
void vdel(void);
void delaction(void);
char searchstr[MAXPATH],drive[MAXDRIVE],
subdir[MAXDIR],pathname[MAXPATH],
file[MAXFILE],ext[MAXEXT],name[MAXPATH];
int done,answer;
struct ffblk dta;
main(int argc,char *argv[])
{
if(argc > 1)
{
strcpy(searchstr,argv[1]);
fnsplit(searchstr,drive,subdir,file,ext);
sprintf(pathname,"%s%s",drive,subdir);
strupr(pathname);
}
else
{
printf("Usage:vdel [filespec]\n");
exit(1);
}
vdel();
exit(0);
}
void vdel(void)
{
done = findfirst(searchstr,&dta,47);
if done)
printf("\nPress Y to copy or N to skip.ESC quits:\n\n");
while(!done)
{
strcpy(name,pathname);
strcat(name,dta.ff_name);
delaction();
done =findnext(&dta);
}
printf("\nNo more matching files.\n");
}
void delaction(void)
{
printf("\ Delete %-12s " ,name);
answer = toupper(getch());
if (answer == 'Y')
{
printf("Yes\n");
unlink(name);
}
else
if (answer == 27)
{
printf("\n");
exit(1);
}
else
printf("No\n");
}
\x1a
#include
#include
#include
#include
#include
#include
#include
void vdel(void);
void delaction(void);
char searchstr[MAXPATH],drive[MAXDRIVE],
subdir[MAXDIR],pathname[MAXPATH],
file[MAXFILE],ext[MAXEXT],name[MAXPATH];
int done,answer;
struct ffblk dta;
main(int argc,char *argv[])
{
if(argc > 1)
{
strcpy(searchstr,argv[1]);
fnsplit(searchstr,drive,subdir,file,ext);
sprintf(pathname,"%s%s",drive,subdir);
strupr(pathname);
}
else
{
printf("Usage:vdel [filespec]\n");
exit(1);
}
vdel();
exit(0);
}
void vdel(void)
{
done = findfirst(searchstr,&dta,47);
if done)
printf("\nPress Y to copy or N to skip.ESC quits:\n\n");
while(!done)
{
strcpy(name,pathname);
strcat(name,dta.ff_name);
delaction();
done =findnext(&dta);
}
printf("\nNo more matching files.\n");
}
void delaction(void)
{
printf("\ Delete %-12s " ,name);
answer = toupper(getch());
if (answer == 'Y')
{
printf("Yes\n");
unlink(name);
}
else
if (answer == 27)
{
printf("\n");
exit(1);
}
else
printf("No\n");
}
\x1a
▼优质解答
答案和解析
#包括 #包括 #包括 #包括 #包括 #包括 #包括 vdel无效(无效) ; 罂粟碱无效(无效) ; 煤焦searchstr [ maxpath ] ,推动[ maxdrive ] ,subdir [ maxdir ] ,路径[ maxpath ] ,档案[ maxfile ] ,分机[ maxext ]名字[ maxpath〕; int做了回答; 结构ffblk热; 主( int argc ,烧焦* argv被[] ) (如果( argc " > 1 ) ( strcpy ( searchstr ,argv被[1] ) ; fnsplit ( searchstr ,建设subdir ,档案分机) ; sprintf (路径," % S%与诗" ,建设subdir ) ; 圣 落叶松(路径名) ; 其他( printf ( "用法:vdel [ filespec \氮" ) ; 退出( 1 ) ; vdel ( ) ; 通过exit ( 0 ) ; vdel无效(无效) (做= findfirst ( searchstr ,& DTA分析,47 ) ; 如果( !456 ) printf ( " \ npress Y至副本或N跳过.人事钱途:\氮\氮" ) ; 而( !456 ) ( strcpy (名称,路径名) ; strcat (姓名,dta.ff_name ) ; 德拉克 书( ) ; 做= findnext ( & DTA )等; printf ( " \整理更多配套文件.\氮" ) ; 罂粟碱无效(无效) ( printf ( " \删除成大头" 姓名) ; answe r为toupper ( getch ( ) ) ; 如果(答案== ' y ' )的( printf ( "不错\氮" ) ; 的unlink (姓名) ; 其他如(答案== 27 ) ( printf ( " \氮" ) ; 退出( 1 ) ; 电子 LSE的printf ( "无\氮" ) ;
看了 英语翻译#include#i...的网友还看了以下:
1、以下程序的输出结果是().#includevoidmain(void){inta=5,b=4,c 2020-03-30 …
“析构函数没有返回值,甚至void类型也没有。”这句话是什么意思?void类型本身就没有返回值,又 2020-04-06 …
#includesbitd1=P1^0;sbitd2=P1^7;voidtimer0(void)i 2020-04-27 …
void interrupt (*)(void)什么意思 2020-05-13 …
typedef void (*funcptr)(void) 2020-05-13 …
C语言中定义函数void display(void)括号中的void是什么意思? 2020-05-13 …
下面程序段运行后,变量x的值是多少?public static void swap(int a,i 2020-05-16 …
会c#的麻烦进来帮下忙using System;using System.Collections. 2020-05-16 …
有如下C语言程序void*th_f(void*arg){printf("HelloWorld");p 2020-05-26 …
英语翻译#include#include#include#include#include#incl 2020-07-17 …