Guest User

Untitled

a guest
Nov 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. #include<time.h>
  5. void delay(unsigned int mseconds);
  6.  
  7. int main( int argc, char *argv[])
  8. {
  9. FILE *fin,*fo;
  10. if(argc!=3)
  11. {
  12. printf("error! correct arg no is 3 \n");
  13. getch();
  14. exit(1);
  15. }
  16. fin=fopen(argv[1],"r");
  17. fo=fopen(argv[2],"w");
  18. if(fin== (FILE *)0)
  19. {
  20. printf("file error!\n");
  21. exit(1);
  22. }
  23. int byte;
  24. int count=0;
  25. int i=0;
  26. do{
  27. byte=getc(fin);
  28. if(byte!=EOF)
  29. {
  30. fputc(byte,fo);
  31. }
  32. i++;
  33. }while(byte!=EOF);
  34.  
  35. fclose(fo);
  36. fclose(fin);
  37. system("notepad e:\\path1.txt");
  38.  
  39. return 0;
  40. }
  41.  
  42. void delay(unsigned int mseconds)
  43. {
  44. clock_t goal = mseconds + clock();
  45. while (goal > clock());
  46. }
Add Comment
Please, Sign In to add comment