我有这段代码; 它直接写入参数时有效system(),如果将参数传递给它则不起作用.有什么帮助吗?
char dest[100];
char file[50];
char dir[100];
printf("Enter source path: ");
scanf("%s", dir);
printf("Enter filename: ");
scanf("%s", file);
printf("Enter destination path: ");
scanf("%s", dest);
system("move \"c:\\users\\putty.exe\" g:\\ \n" ); /* <--works */
system("move \"%s%s\" %s", dir,file,dest); /* <--doesn't work */
Run Code Online (Sandbox Code Playgroud)