代码:



1
12 #include <stdio.h>
13
14 int main(int argc, char **argv)
15 {
16 char ch;
17 printf("please select operation: r or d: ");
18 scanf("%c", &ch);
19 int tmp = getchar();
20 if(ch == 'r'){
21 int ren = rename("kolkata.txt", "city.dat");
22 if(0 == ren){
23 puts("Operation of renaming a file is successful.");
24 }else{
25 puts("Operation of renaming a file is failed!");
26 }
27 }
28
29 if(ch == 'd'){
30 int rem = remove("city.dat");
31 if(0 == rem){
32 puts("Operation of deletion a file is successful.");
33 }else{
34 puts("Operation of deletion a file is failed!");
35 }
36 }
37
38 return 0;
39 }


 


人就像是被蒙着眼推磨的驴子,生活就像一条鞭子;当鞭子抽到你背上时,你就只能一直往前走,虽然连你也不知道要走到什么时候为止,便一直这么坚持着。